DateTime vs DateTimeOffset

前端 未结 10 1849
刺人心
刺人心 2020-11-22 00:23

Currently, we have a standard way of dealing with .NET DateTime\'s in a TimeZone aware way: Whenever we produce a DateTime we do it in UTC (e.g. us

10条回答
  •  遥遥无期
    2020-11-22 00:41

    A major difference is that DateTimeOffset can be used in conjunction with TimeZoneInfo to convert to local times in timezones other than the current one.

    This is useful on a server application (e.g. ASP.NET) that is accessed by users in different timezones.

提交回复
热议问题