views:

573

answers:

2

Does ColdFusion 8 have any built-in support for handling timezones? We'd like our users to be able to choose a timezone and then have all dates/times on the site adjusted to their locale. Currently we're asking users to set an offset from server time, and it's a headache because they have to go in a couple times each year and manually adjust for daylight savings time.

We're running CF8 on Windows and all dates/times are stored in SQL Server 2005 in Pacific Time. So when Windows auto-adjusts the local clock between Daylight and Standard time, a certain number of our users need to adjust their offset from server time.

I've looked through the International Functions, and none of them seem to convert between timezones. We don't want to turn to a Web Service to get offset/daylight info if it's built into the JVM, and ideally we'd stick with CF functions if they're available. Seems like a common need so I'm surprised there's nothing built into CF to handle this. Is there?

+2  A: 

GetTimeZoneInfo() will tell you if daylight saving time is currently in effect on the server, you could use this information along with a checkbox for DST when the user selects their server time offset.

Pablo
I appreciate the answer, and I've given it some thought. We're trying to get away from offsets altogether and have the server handle the DST shifts across the globe. We want users to pick a timezone and have the server calculate everything. Unfortunately those DST shifts don't all happen at the same time, so knowing the current state of the server doesn't help too much.
pb
I understand, it's not a simple solution any way you approach it. I'm not aware of any CF or Java-based solution you could use for that, unfortunately. The various locations around the globe that don't abide by DST won't help matters much either.
Pablo