Reputation: 895
I am writing an Entity Framework 4.1 application. In this application I have a History
class defined as follows:
public class History
{
public Guid Id { get; set; }
public DateTime HistoryDate { get; set; }
}
However, when I look in the database, it appears to store the date as local time. My company doesn't exist in one time zone and so will this cause issues? Is there something more I need to do to store the date and time as UTC, or is it already stored as UTC in SQLite and I'm just seeing the result in my local time. Here is some sample output of what I see:
select id, historydate from history limit 1;
000846d3-f91d-47bb-9963-baf9530e0229|2004-10-28 16:57:00
Thanks in advance!
Upvotes: 3
Views: 3317
Reputation:
Store the date in UTC, and use the ToLocalTime when accessing the value to have it in local time: http://msdn.microsoft.com/en-us/library/system.datetime.tolocaltime.aspx
Upvotes: 5