DateTime vs. DateTimeOffset in .NET
DateTime was the first type the .NET Framework had to represent times. Unfortunately, it very quickly became apparent that DateTime had a design flaw: the times are not unique.
Therefore, with .NET 2.0, DateTimeOffset was introduced very early to correct these issues.
Nevertheless DateTime has a high prevalence: and thus a huge error potential due to missing time information.
It is high time to replace DateTime with DateTimeOffset.
Benjamin Abt
July 19, 2021
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.