Storing DateTime (UTC) vs. storing DateTimeOffset

Posted by Frederico on Stack Overflow See other posts from Stack Overflow or by Frederico
Published on 2011-01-17T16:48:23Z Indexed on 2011/01/17 16:53 UTC
Read the original article Hit count: 245

I usually have an "interceptor" that right before reading/writing from/to the database does datetime conversion (from UTC to localtime, and from localtime to utc), so I can use DateTime.Now (derivations and comparisions) throughout the system without worrying about timezones.

Regarding serialization and moving data between computers, there is no need to bother, as the datetime is always UTC.

Should I continue storing my dates (SQL 2008 - datetime) in UTC format or should I instead store it using DateTimeOffset (SQL 2008 - datetimeoffset)?

UTC Dates in the database (datetime type) have been working and known for so long, why change it? What are the advantages?

I have already looked into articles like this one, but I'm not 100% convinced though. Any thoughts?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server