Click here to Skip to main content
12,359,102 members (32,935 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

24.3K views
1 bookmarked
Posted

How to convert UTC time to Local Time

, 3 Jan 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
In my opinion, Local to UTC time conversion should be done nearer to UI level. That is, you should pass UTC time to your query and the time should be converted later when it is displayed to the user.Doing the conversion in code will simplify SQL queries and thus probably improve overall...
In my opinion, Local to UTC time conversion should be done nearer to UI level. That is, you should pass UTC time to your query and the time should be converted later when it is displayed to the user.

Doing the conversion in code will simplify SQL queries and thus probably improve overall performance. Also, it would be much more easier to allows the user to select which time zone to use. Most of the time, the time zone is only a display property and all the logic is done with UTC time.

License

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

Share

About the Author

Philippe Mori
Software Developer (Senior)
Canada Canada
Programmer at Maid LABS from 2003 (www.maidlabs.com)

Programmer-Analyst at Viasat Geo Technoligies from 1995 to 2002 (www.viasat-geo.com).

I have studied at École Polytechnique de Montréal in computer engineering.

You may also be interested in...

Comments and Discussions

 
Questionhow can i convert UTC time to local time? Pin
amit_835-Jan-15 21:48
memberamit_835-Jan-15 21:48 
GeneralReason for my vote of 5 true! Pin
filoteanuadrian3-Jan-12 2:22
memberfiloteanuadrian3-Jan-12 2:22 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 3 Jan 2012
Article Copyright 2012 by Philippe Mori
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid