DateTime.MinValue should not be converted to utc#297
DateTime.MinValue should not be converted to utc#297ErikWitkowski wants to merge 3 commits intooysteinkrog:masterfrom
Conversation
|
I'm weary of adding special cases like this, can you explain the rationale behind it? |
|
Sure! This special case needs atention because today in SQLLite.NET-PCL, when you save a DateTime.MinValue to database and load it back, it's not a DateTime.MinValue anymore if you are west of London. Date: Wed, 11 May 2016 10:56:18 -0700 I'm weary of adding special cases like this, can you explain the rationale behind it? — |
|
What about DateTime.MaxValue? |
|
I don't have the same concern about MaxValue since it's not the default value for DateTime. To be more specific, I've found this problem when moving data from SQLLite to SQLServer (through WebService integration), since SQLServer won't support the "01/01/01 03:00:00" value (result of MinValue plus 3 hours of my local time). At first I've worked this around by creating all DateTime.MinValue by specifing utc: DateTime myDateTime = DateTime.SpecifyKind(DateTime.MinValue, DateTimeKind.Utc); If we commit this code, people won't need the code above to properly initiate a datetime value. |
No description provided.