Skip to content

TimeZoneInfo.ConvertTime - different results for .NET 10 and .NET 11 #126940

Closed

Description

@gleb-cherkashin

Description

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:

TimeZoneInfo sourceTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Mauritius Standard Time");   // UTC+4 
TimeZoneInfo destinationTimeZone = TimeZoneInfo.FindSystemTimeZoneById("Arabic Standard Time"); // UTC+3
DateTime earlyDate = new DateTime(0001, 01, 01, 1, 13, 15);
DateTime converted = 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

Regression?

In .NET 10 conversion result was correct.

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. added
    untriaged
    on Apr 15, 2026
  2. dotnet-policy-service commented on Apr 15, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @dotnet/area-system-datetime
    See info in area-owners.md if you want to be subscribed.

  3. self-assigned this
    on Apr 15, 2026
  4. removed
    untriaged
    on Apr 15, 2026
  5. added this to the 11.0.0 milestone on Apr 15, 2026
  6. added a commit that references this issue on Apr 16, 2026
    8a98a9a
  7. added a commit that references this issue on Apr 16, 2026
    f9892f6
  8. locked and limited conversation to collaborators on May 17, 2026
  9. added a commit that references this issue on Jul 15, 2026
    02721cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions