Click here to Skip to main content
15,885,908 members
Articles / Database Development / SQL Server
Alternative
Tip/Trick

How to convert UTC time to Local Time

Rate me:
Please Sign up or sign in to vote.
3.40/5 (4 votes)
2 Jan 2012CPOL 14.7K   2
I wanted to point out that while I agree with the general approach (storing DateTime in UTC and converting into local time for display as well as accepting input in local time), it's not always what the requirements call for. If you're creating a meeting calendar, then of course it's perfect,...
I wanted to point out that while I agree with the general approach (storing DateTime in UTC and converting into local time for display as well as accepting input in local time), it's not always what the requirements call for. If you're creating a meeting calendar, then of course it's perfect, or in fact anything where the time displayed need to be universal... but there are applications where the underlying intent is to different. For example, the office closes early, at 4:00 on new years eve this year. You don't want your folks who work in the USA leaving work at 16:00 Ukrainian time :).

I guess what I mean to get across is that DateTime work is tricky enough even when the intent is clear, but the intent is not always the same. So it's good to make sure you're solving the right problem.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager
United States United States
I've been programming in C, C++, Visual Basic and C# for over 35 years. I've worked at Sierra Systems, ViewStar, Mosaix, Lucent, Avaya, Avinon, Apptero, Serena and now Guidewire Software in various roles over my career.

Comments and Discussions

 
GeneralMy vote of 1 Pin
Bruce Schiller25-Jan-13 14:35
Bruce Schiller25-Jan-13 14:35 
The article says absolutely nothing of value
GeneralRe: My vote of 1 Pin
Tom Clement25-Jan-13 15:28
professionalTom Clement25-Jan-13 15:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.