You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TimeZoneInfo.ConvertTime - different results for .NET 10 and .NET 11 #126940
I have detected a case where TimeZoneInfo.ConvertTime returns different results for .NET 10 and for .NET 11 (checked Preview 3 also). The issue takes place for date-time conversions that are close to DateTime.MinValue (e.g. when converting new DateTime(0001, 01, 01, 1, 13, 15) from UTC+4 to UTC+3). For .NET 11 the result seems to be wrong.
I guess the origin of the issue is related to TimeZone Improvements for .NET 11.
Reproduction Steps
set 2 time zones and some DateTime close to DateTime.MinValue (The date and time must be such that when converted to UTC, the date must change the era to BC);
note that this DateTime is valid in source time zone and will be valid (still in AD era) after conversion to time zone 2;
try to convert this DateTime from one time zone to another.
for .NET 10 result conversion will be correct;
for .NET 11 result conversion will be incorrect and equal to MinValue + time zone shift.
The simple example below represents the behavior:
TimeZoneInfosourceTimeZone=TimeZoneInfo.FindSystemTimeZoneById("Mauritius Standard Time");// UTC+4 TimeZoneInfodestinationTimeZone=TimeZoneInfo.FindSystemTimeZoneById("Arabic Standard Time");// UTC+3DateTimeearlyDate=newDateTime(0001,01,01,1,13,15);DateTimeconverted=TimeZoneInfo.ConvertTime(earlyDate,sourceTimeZone,destinationTimeZone);// .NET 11: {1/1/0001 3:00:00 AM}// .NET 10: {1/1/0001 12:13:15 AM}
Expected behavior
Conversion result of new DateTime(0001, 01, 01, 1, 13, 15) from UTC+4 to UTC+3 for .NET 11 should be equal to {1/1/0001 12:13:15 AM}
Actual behavior
Actual conversion result is {1/1/0001 3:00:00 AM} for .NET 11
Activity
dotnet-policy-service commentedon Apr 15, 2026
Tagging subscribers to this area: @dotnet/area-system-datetime
See info in area-owners.md if you want to be subscribed.
Fix TimeZoneInfo.ConvertTime producing wrong results near DateTime.Mi…
Fix TimeZoneInfo.ConvertTime producing wrong results near DateTime.Mi…
Fix TimeZoneInfo.ConvertTime producing wrong results near DateTime.Mi…