You want a tuna sandwich? Sure you don't want a second hand moped?
I've spent most of the day trying to figure out how to convert times across timezones in .net and it just reminded me of why i hate technical forums.
Guys that post on technical forums are like spam comments... the more questions they answer the more their popularity goes up, the more questions they get asked, the more work they get etc etc.
But why when you ask one question, does the "guru" try and tell you something else.... e.g, the question I have seen asked about 1000 times today...
Q. How do you convert UTC times into local times if I know the timezone offset of the user from their profile, but taking in to account Daylight saving time?
Here are some of the [edited] answers.
A. You should use a javascript clock to get the offset and compare that against the server time.
WRONG! - The questioner didn't ask you how to get the offset, he already has it.
A. Why not just use the .AddHours() function and add the offset to the time.
WRONG - Read the question! taking into ACCOUNT of daylight savings time... does ADDHOURS() accoutn for that? no didn't think so.
The list goes on, with about 100 variations of the above answers... in short, .Net is pretty crap at handling timezones, and if there is a good example its buried in the interwebs.
Sigh.
Comments
(I just wanted to say that.)