C# は、タイムゾーンを変換するときに夏時間を考慮しますか?
ロンドンの現在時刻のソース日付があり、タイムゾーン (CET) に変換したいと考えています。これが私が使用しているコードです。
DateTime time = DateTime.ParseExact(timeString, "HH:mm", null);
time = DateTime.SpecifyKind(time, DateTimeKind.Unspecified);
//Convert it to the right timezone. It is currently in GMT
TimeZoneInfo gmt = TimeZoneInfo.FindSystemTimeZoneById("GMT Standard Time");
TimeZoneInfo current = TimeZoneInfo.Local;
DateTime utc = TimeZoneInfo.ConvertTimeToUtc(time, gmt);
DateTime local = TimeZoneInfo.ConvertTimeFromUtc(utc, core.startTime = local;
現在、うまく機能しています。しかし、DST がその醜い頭をもたげたとき、それは機能し続けますか、それとも恐ろしく壊れますか? 過去にたくさんの問題があったため、TimeZones には少し警戒しています。