Open Maschina opened 7 years ago
I think this is by design not a bug
@alanspires Yes, I think you are correct, although the behaviour does not seem to be consistent when StoreDateTimeAsTicks is false.
From what I can ascertain, regardless, the ORM will convert the datetime object to UTC when stored in the database, however on retrieval (ReadCol) it will convert to UTC only if stored as ticks. If stored as a string, it will convert to local time via DateTime.Parse().
So, SqlCommand.cs the calls to DateTime.Parse(), should be using DateTimeStyles.AdjustToUniversal.
What do you think?
As soon as I am retrieving a stored value from sqlite back to the app, the DateTime values are not automatically converted back to local time. For example: I am storing a value such as 2016-11-23T15-23-00. When reading back this value while the machine that runs the app is configured for CET (UTC+1), the result will be 2016-11-23T14-23-00, which is GMT (UTC+0).