Server time & Daylight saving.

Redster

Perch
I need to display date & time on my website which is hosted on WINCF. I am located in the GMT +8 time zone. I should offset the server time to +13 or +12 depending on the DST setting?

Should I set +12 for the dates listed below:

2004 April 4 to October 31
2005 April 3 to October 30
2006 April 2 to October 29
2007 April 1 to October 28
2008 April 6 to October 26
2009 April 5 to October 25
2010 April 4 to October 31
 
Redster said:
I need to display date & time on my website which is hosted on WINCF. I am located in the GMT +8 time zone. I should offset the server time to +13 or +12 depending on the DST setting?

Should I set +12 for the dates listed below:

2004 April 4 to October 31
2005 April 3 to October 30
2006 April 2 to October 29
2007 April 1 to October 28
2008 April 6 to October 26
2009 April 5 to October 25
2010 April 4 to October 31
Boy are you in for a headache. Daylight time is a beast. I have been looking into this lately and it seems that in some places around the world, the date that daylight time starts and ends differs and sometime with no rules. It's quite a mess actually. There are lots of references on the Internet as to when Daylight time starts and ends, the problem is determining which one is correct.
 
Sorry, I should have at least offered some help.

If all you want to do is correctly calculate GMT, you can assume the server is in EST and does observe DST. The rule for most of North Amercia is DST starts the first Sunday in April, and ends the last Sunday is October.
 
If you are proficient in programming, i have a set of ASP functions (VBScript) you could look at to guide you in working with the time conversions. Basically what it does is:

You specify (hardcoded) the server's UTC offset (-5 for jodohost)
get Server Time
subtract/add the offset from the server time to get UTC (GMT) time (function actually returns full date)
Then the beauty is in the US-DST function. It evaluates the UTC time from the first function, adds a new timezone/offset to it (if you want to localise for another timezone otherwise use the server offset) and based on government timezone standards, evaluates whether to use calculate for DST or not based on your timezone (i.e. will not calculate DST if the UTC offset provided is not in the applicable range). Then the function knows whether to add an hour or not. (alternately it returns information like "days to Standard Time, Days to Daylight Savings Time" for diagnosing problems.
and there you have it.

This was a PAIN in the *** to do originally, namely because of working with strange standards (since not ALL of the US follows DST)

let me know if the script would be any help to you, i'm not familiar with Cold Fusion so i couldnt help you there.
 
Back
Top