Re:Storing UTC is not a silver bullet (2019)
by briHass on Sunday March 13, 2022 @09:03AM
(#30660881)
A similar issue can get developers in trouble with dates, specifically the YYYY-MM-DD for a given event. In C# for instance, there used to only be the DateTime, which stored a date AND a time, which was set to 00:00:00. It was on you to know to ignore the time in comparisons and/or always use the DateTime.Date method to compare with a 00:00 DateTime. This was fixed with the introduction of DateOnly (https://docs.microsoft.com/en-us/dotnet/api/system.dateonly?...).
Databases usually have types to represent just dates or dates/times. Always use the lowest resolution type to represent what you actually are trying to capture.
Databases usually have types to represent just dates or dates/times. Always use the lowest resolution type to represent what you actually are trying to capture.