Storing datetime in database?

Posted by Curtis White on Stack Overflow See other posts from Stack Overflow or by Curtis White
Published on 2010-05-25T16:13:38Z Indexed on 2010/05/25 16:21 UTC
Read the original article Hit count: 239

Filed under:
|
|

I'm working on a blog and want to show my posts in eastern time zone. i figured that storing everything UTC would be the proper way. This creates a few challenges though:

  1. I have to convert all times from UTC to Eastern. This is not a biggie but adds a lot of code.

  2. And the "biggie" is that I use a short-date time to reference the posts by passing in a query, ala blogger. The problem is that there is no way to convert the short date time to the proper UTC date because I'm lacking the posted time info.

Hmm, any problem to just storing all dates in eastern time? This would certainly make it easier for the rest of the application but if I needed to change time zones everything would be stored wrong.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about sql