Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Sep 18, 2019 2:39 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Program displays incorrect date format in Linux
PostPosted: Mon Feb 15, 2010 3:34 pm 
Offline

Joined: Sun Feb 14, 2010 11:19 pm
Posts: 213
Location: Australia
My program runs fine on Mac and Windows but the Linux version displays dates in US format mm/dd/yyyy instead of Australian (UK) dd/mm/yyyy
I am running several Linux distros inside Virtualbox for Windows - Ubuntu, Mandriva ... and I have checked the control panel settings to ensure the system is set to the Australian format. I have also checked VirtualBox settings.
But the program still displays the month before the day. Also Functions such as parsedate return an error with dates that would be invalid in US eg. "22/1/2010".

If I can't get to the bottom of this is there a function which will retrieve the country settings from the OS so I can conditionally format the date myself?


Top
 Profile  
Reply with quote  
 Post subject: Re: Program displays incorrect date format in Linux
PostPosted: Tue Feb 23, 2010 3:59 pm 
Offline

Joined: Sun Feb 14, 2010 11:19 pm
Posts: 213
Location: Australia
Could someone please have a look at this for me I'm stuck. If it happens on all machines it's a major bug.
If you have Linux can you please temporarily change your Date settings to UK (dd/mm/yyyy) and try a little proceedure -

Dim todaysDate as Date
todaysDate = new Date
msgbox str(todaysDate)


Top
 Profile  
Reply with quote  
 Post subject: Re: Program displays incorrect date format in Linux
PostPosted: Tue Feb 23, 2010 4:19 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 3:53 pm
Posts: 3261
Location: England
Sorry, not currently on Linux but I always use
msgbox todaysDate.ShortDate

_________________
Steve Garman
Using REALbasic 2008r2 Professional on Windows Vista Ultimate
and REALbasic 2009r5.1 Professional on Linux Ubuntu 9.04 Desktop
and REAL Studio 2010r1 Personal on Linux Ubuntu 9.10 Desktop
Occasional blog


Top
 Profile  
Reply with quote  
 Post subject: Re: Program displays incorrect date format in Linux
PostPosted: Wed Feb 24, 2010 2:19 am 
Offline

Joined: Sun Feb 14, 2010 11:19 pm
Posts: 213
Location: Australia
In vb converting a date to a string is an easy way of applying the correct regional date format (hence the long approach).
Are you saying the shortdate property does the same, or are you just showing me a way to shorten my code.


Top
 Profile  
Reply with quote  
 Post subject: Re: Program displays incorrect date format in Linux
PostPosted: Wed Feb 24, 2010 2:50 am 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
Yes, the ShortDate property is what you should use. It obeys the system settings. Using Str() to convert a date is undefined.


Top
 Profile  
Reply with quote  
 Post subject: Re: Program displays incorrect date format in Linux
PostPosted: Wed Feb 24, 2010 4:35 am 
Offline

Joined: Sun Feb 14, 2010 11:19 pm
Posts: 213
Location: Australia
timhare wrote:
Yes, the ShortDate property is what you should use. It obeys the system settings. Using Str() to convert a date is undefined.


Okay that sounds good but my program is currently throwing an error when I attempt to parse the date entered in a text field eg. (UK regional format - dd/mm/yyyy) 24/02/2010
It returns not a valid date when in fact it is.

I can't convert it to a date therefore I can't use the shortdate property.

Since this only happens under Linux the only solution I can think of is getting the systems country setting either automatically (??) or as part of the program setup options then doing messy string extractions for UK format countries (anyone got a list of them?) to extract day and month from the users text input so I can build a date string in US format for storage in my database. Then I have to convert it back to display it correctly on UK systems.

Very messy and fraught with danger, especially when there is no easy way to check that the string is a proper date in the first place.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group