Skip to content

Commit 9d66cfb

Browse files
MaximLipninscott-ferguson-unity
authored andcommitted
Fix ambiguous time at the end of DST period on Windows
1 parent 329442f commit 9d66cfb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mcs/class/corlib/System/TimeZoneInfo.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,9 @@ bool IsInDSTForYear (AdjustmentRule rule, DateTime dateTime, int year)
955955
DateTime DST_end = TransitionPoint (rule.DaylightTransitionEnd, year + ((rule.DaylightTransitionStart.Month < rule.DaylightTransitionEnd.Month) ? 0 : 1));
956956
if (dateTime.Kind == DateTimeKind.Utc) {
957957
DST_start -= BaseUtcOffset;
958-
DST_end -= (BaseUtcOffset + rule.DaylightDelta);
958+
DST_end -= BaseUtcOffset;
959959
}
960+
DST_end -= rule.DaylightDelta;
960961
return (dateTime >= DST_start && dateTime < DST_end);
961962
}
962963

0 commit comments

Comments
 (0)