Hey ASP.NET Gurus,
How do you guys handle timezone and daylightsavings in ASP.NET or should I say...what is the correct way to handle them together?
Currently, we managed to get everything setup straight to handle timezone differences, so basically if you assign a task in Beijing China with a Due date 1/31/2008 12:00:00am, users in U.S eastern shore will see a Due date 1/30/2008 11:00am instead. (13 hours of difference automatically adjusted depends on which user logs in to see it)
However, things get a little complicated with DayLightSavings comings in. For example, assuming a server admin wants to schedule a server shutdown at 2:30am during the "Spring forwards" (adds an hour in the spring) and the switch occurs at 2:00am. We have a problem already!! why?
The clock goes 1:58am, 1:59am, 3:01am. There is no such thing as 2:30am.
*Edit*
Just to make sure you understand why I feel it's important. Suppose it's the "Falls Back" time (removes the hour) and server admin simply said we will schedule a shutdown 1:30am. So we have
1:30am...... 1:58am, 1:59am, 1:00am...1:30am. (1:30 am occurs twice)
The user mis-interpreted the message, thinking server admin meant 1:30am after "fallsBack", so he's doing he's stuff online and all, but server admin meant 1:30am before "falls back", so you see? when the server admin shuts down the server, the user suddenly lost his data while doing the app. This could cause big problems.
I looked at the implementations out there already, articles, but no one seems to have a set of standard rules to handles these in .NET 2.0. (I see .NET 1.1 stuffs, but lots of them are either addressed in 2.0 or changed a bit)
Any suggestion is appreciated it.
How do you guys handle timezone and daylightsavings in ASP.NET or should I say...what is the correct way to handle them together?
Currently, we managed to get everything setup straight to handle timezone differences, so basically if you assign a task in Beijing China with a Due date 1/31/2008 12:00:00am, users in U.S eastern shore will see a Due date 1/30/2008 11:00am instead. (13 hours of difference automatically adjusted depends on which user logs in to see it)
However, things get a little complicated with DayLightSavings comings in. For example, assuming a server admin wants to schedule a server shutdown at 2:30am during the "Spring forwards" (adds an hour in the spring) and the switch occurs at 2:00am. We have a problem already!! why?
The clock goes 1:58am, 1:59am, 3:01am. There is no such thing as 2:30am.
*Edit*
Just to make sure you understand why I feel it's important. Suppose it's the "Falls Back" time (removes the hour) and server admin simply said we will schedule a shutdown 1:30am. So we have
1:30am...... 1:58am, 1:59am, 1:00am...1:30am. (1:30 am occurs twice)
The user mis-interpreted the message, thinking server admin meant 1:30am after "fallsBack", so he's doing he's stuff online and all, but server admin meant 1:30am before "falls back", so you see? when the server admin shuts down the server, the user suddenly lost his data while doing the app. This could cause big problems.
I looked at the implementations out there already, articles, but no one seems to have a set of standard rules to handles these in .NET 2.0. (I see .NET 1.1 stuffs, but lots of them are either addressed in 2.0 or changed a bit)
Any suggestion is appreciated it.