Wrong logic of DateTime.SpecifyKind
Ali1Jamal opened this issue · 0 comments
Ali1Jamal commented
Steps To Reproduce
https://dev.deck.net/9d292f241ded3180d8118d9bdb1e4edd
public class Program
{
public static void Main()
{
DateTime date = DateTime.SpecifyKind(DateTime.Today, DateTimeKind.Utc);
Console.WriteLine(date.ToString("u"));
}
}
to compare:
https://dev.deck.net/4916fff18f204ff5d2e171dfbd1cbde9
Expected Result
2019-08-05 00:00:00Z
Actual Result
// Depending on time zone
UTC+1 - 2019-08-04 23:00:00Z
UTC+2 - 2019-08-04 22:00:00Z
etc
i think to fix this issues by change this line :
https://github.com/theolivenbaum/h5/blob/d9c8a733e6b55584c3bd37b1f461ae9378882550/H5/H5/shared/System/DateTime.cs#L734
with this :
return new DateTime(value.Ticks, kind);