Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

Tagged as

How to convert UTC time to Local Time

, 2 Jan 2012
Rate this:
Please Sign up or sign in to vote.
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 Smile | :) .
 
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)

Share

About the Author

Tom Clement
Team Leader
United States United States
I've been programming in C, C++, Visual Basic and C# for almost 30 years. I've worked at Sierra Systems, ViewStar, Mosaix, Lucent, Avaya, Avinon, Apptero and now Serena in various roles over my career.

Comments and Discussions

 
GeneralMy vote of 1 PinmemberBruce Schiller25-Jan-13 14:35 
GeneralRe: My vote of 1 PinmentorTom Clement25-Jan-13 15:28 

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

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

| Advertise | Privacy | Mobile
Web03 | 2.8.140821.2 | Last Updated 2 Jan 2012
Article Copyright 2012 by Tom Clement
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid