Changing timezone in Windows is not reflected in C# TimeZone calls
问题 On Windows 7. I am in PST TimeZone. I changed the timezone in Windows to Eastern and then executed this in LinqPad: TimeZoneInfo tzinfo = TimeZoneInfo.Local; tzinfo.Dump(); TimeZone localZone = TimeZone.CurrentTimeZone; localZone.Dump(); Why is it not showing Eastern timezone and why one structure is showing Pacific timezone and the other Eastern? 回答1: .NET Caches the local time zone. If you need to be sure that you account for changes the user may have made, you need to call TimeZoneInfo