Difference between UTC and GMT Standard Time in .NET

后端 未结 7 996
臣服心动
臣服心动 2020-11-27 04:45

In .NET, the following statements return different values:

Response.Write(
  TimeZoneInfo.ConvertTime(
    DateTime.Parse("2010-07-01 5:30:00.000"),         


        
7条回答
  •  旧巷少年郎
    2020-11-27 05:28

    The TimeZoneInfo object having the .Id of "GMT Standard Time" corresponds to the .DisplayName of "(UTC) Dublin, Edinburgh, Lisbon, London".

    This time zone uses Greenwich Mean Time (GMT) (UTC+0) during the winter months, and British Summer Time (BST) (UTC+1) during the summer months.

    Reference here.

    The time zone for UTC has an .Id of "UTC" and a .DisplayName of "(UTC) Coordinated Universal Time".

    They are two different time zone settings.

    Also, when looking at the list of time zone display names in Windows:

    Time Zone List

    The value in parenthesis is just the standard offset, so while it looks like there are four different settings for UTC, there is really only one. It's just that the other three zones use UTC as their base offset when Daylight Saving Time is not in effect.

提交回复
热议问题