ConvertTimeFromUTC, Handling Australia DST

后端 未结 1 850
夕颜
夕颜 2021-01-23 22:10

I have the following code, and I have a a customer in Canberra, Australia. They are typically UTC+10, however they are in DST right now so it is UTC+11. What is odd is when I ru

相关标签:
1条回答
  • 2021-01-23 22:41

    Use "AUS Eastern Standard Time" for South-East Australia (New South Wales and Victoria) that uses DST, including Canberra, Melbourne, Sydney, etc.

    Use "E. Australia Standard Time" for North-East Australia (Queensland) that does not have DST, including Brisbane, Lindeman, etc.

    Otherwise, your code is correct.

    Note that despite having the word "Standard" in the time zone IDs, .NET and Windows will correctly account for DST where applicable. There are no IDs that have the word "Daylight" in them.

    For a complete list of time zones, use TimeZoneInfo.GetSystemTimeZones() and examine the .Id and .DisplayName properties of each. Alternatively, call tzutil.exe /l on the command line which will do the same.

    0 讨论(0)
提交回复
热议问题