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.
Related posts:
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.
[Reply]
Oh and make sure you set the format string on the date picker it defaults to US style dates.[Reply]
use LSParseDateTime(your_date)???[Reply]
And look at the setLocale() function[Reply]
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.
[Reply]