TimeZoneInfo in .NET Core when hosting on unix (nginx)

后端 未结 5 758
半阙折子戏
半阙折子戏 2020-12-09 07:55

For example, when I try to do the following.

TimeZoneInfo.FindSystemTimeZoneById(\"Central European Standard Time\")

I get the error, that

5条回答
  •  甜味超标
    2020-12-09 08:05

    .Net Core using system timezone. Unfortunately Windows and Linux have different timezone system. Now you have two ways:

    • Use other (and universal) impementation of timezone like Noda time
    • Translate between Windows and IANA time zones, e.g. using the TimeZoneConverter micro-library.

提交回复
热议问题