Dates and Times in C#: DateTime, DateTimeOffset, DateOnly, TimeOnly and UTC
Why do a UTC and a local DateTime with the same numbers compare equal? The Kind problem, DateTimeOffset for pinning down a moment, TimeZoneInfo and daylight saving time, DateOnly and TimeOnly from .NET 6, Days versus TotalDays in TimeSpan, culture-aware formatting and parsing, and the store-in-UTC rule.
7 Nov 2026
·
9 min
·
9