I’m saving datetime in t-sql db as UTC and not local time i.e after saving, it loses that it is UTC date ex: 2011-11-08 00:00:00.000. While reading from db in C#, it’s read as local time and not UTC. ex: after reading the dateTime value, a dateTime.ToUniversalTime() gives a different value.
How do I read the db datetime value as UTC and not local time? Or I should saved in local time in t-sql?
Okay, if you’re getting a
DateTimewith aKindofUnspecified, you can just use:This sort of problem is just one of the reasons I dislike
DateTime.