I hate dates and locales

Yes Yes Bad Blogger, I know. smack. Anyways....

I'm having a problem where i'm using a date selector in flex and selecting a date (client running on australian machines), but when its saved to the server it seems to be going in as a US date based on the current server time. How do I fix this? I've tried mucking about with the locale setting in the compiler arguments, I've tried just using CF_SQL_DATE instead of _TIMESTAMP but to no avail. If there are any readers left on this blog I'd appreciate any ideas.

I hate working with dates and regions, it's definitely on my top 5 least enjoyable things in programming.

TrackBacks
There are no trackbacks for this entry.

Trackback URL for this entry:
http://www.tobytremayne.com/trackback.cfm?2EDC60EA-9FF0-85F1-2B89D4A24D0944A3

Comments
Justin Mclean's Gravatar You can solve a few of the issues that crop up if you transfer dates about as strings rather than date objects.

You might also want to check your timezone on your client machine and server. Flash is often 'helpful' in converting dates between timezones for you.

CF_SQL_DATE will save just the date part not the time of a date time so be careful using it.
# Posted By Justin Mclean | 8/9/07 3:05 PM
Justin Mclean's Gravatar Oh and make sure you set the format string on the date picker it defaults to US style dates.
# Posted By Justin Mclean | 8/9/07 3:09 PM
Ashley Gibson's Gravatar use LSParseDateTime(your_date)???
# Posted By Ashley Gibson | 8/9/07 5:39 PM
Jorrit's Gravatar And look at the setLocale() function
# Posted By Jorrit | 11/23/07 6:52 AM
paulH's Gravatar all datetimes in cf are server datetimes, couple that w/the fact that the flash player is trying to be helpful & convert the server dates to clientside timezone (tz) & you better be careful.

if possible set the server to UTC whihc makes handling tz conversions a lot simpler. or change all your datetimes to java epoch offsets.

btw locales have nothing to do w/tz.
# Posted By paulH | 11/23/07 10:59 AM