Skip to content

TimeZoneInfo on .NET 11 (Linux): standard-time offset for Australia/Lord_Howe and 10 other zones between local and UTC midnight of 2038-01-01 (regression from .NET 10) #137673

Description

@lahma

Description

On .NET 11.0.0 with IANA (TZif) time zone data, TimeZoneInfo reports standard time for zones that are in daylight time over the 2037/2038 New Year, for the hours in which the local year is already 2038 and the UTC year is still 2037.

For Australia/Lord_Howe that is 2037-12-31 13:00Z to 2038-01-01 00:00Z: GetUtcOffset returns +10:30 where +11:00 is correct. IsDaylightSavingTime, ConvertTime and ConvertTimeFromUtc give the same wrong answer, so they agree with each other.

.NET 10.0.15 in the same container, reading the same tzdata files, returns +11:00. .NET 11.0.0 on Windows is correct as well.

This is the 2037/2038 part of the "TZ-YEAR-1" entry in #134839. That issue is an untriaged list of many findings against RC1, so this is a separate report: a minimal repro, results on 11.0.0 GA, the scope across all zones, and a suspected line.

Found by a Quartz.NET test when that repository moved to the .NET 11 SDK (quartznet/quartznet#4347).

Reproduction Steps

repro.cs, a file-based app:

using System.Runtime.InteropServices;

Console.WriteLine(RuntimeInformation.FrameworkDescription);
Console.WriteLine(RuntimeInformation.OSDescription);

TimeZoneInfo tz = TimeZoneInfo.FindSystemTimeZoneById("Australia/Lord_Howe");

// Lord Howe daylight time (+11:00) runs from the first Sunday of October to the first Sunday of April.
DateTimeOffset instant = new(2037, 12, 31, 13, 0, 0, TimeSpan.Zero);
Console.WriteLine($"GetUtcOffset(DateTimeOffset) = {tz.GetUtcOffset(instant)}");
Console.WriteLine($"GetUtcOffset(DateTime, Utc)  = {tz.GetUtcOffset(instant.UtcDateTime)}");
Console.WriteLine($"IsDaylightSavingTime         = {tz.IsDaylightSavingTime(instant)}");
Console.WriteLine($"ConvertTime                  = {TimeZoneInfo.ConvertTime(instant, tz):o}");
Console.WriteLine($"ConvertTimeFromUtc           = {TimeZoneInfo.ConvertTimeFromUtc(instant.UtcDateTime, tz):o}");

Console.WriteLine();
Console.WriteLine("Offset changes, 2037-01-01 to 2040-01-01 (UTC instant: old -> new)");
DateTimeOffset t = new(2037, 1, 1, 0, 0, 0, TimeSpan.Zero);
DateTimeOffset end = new(2040, 1, 1, 0, 0, 0, TimeSpan.Zero);
TimeSpan previous = tz.GetUtcOffset(t);
for (t = t.AddMinutes(30); t < end; t = t.AddMinutes(30))
{
    TimeSpan current = tz.GetUtcOffset(t);
    if (current != previous)
    {
        Console.WriteLine($"  {t:yyyy-MM-dd HH:mm}Z: {previous} -> {current}");
        previous = current;
    }
}

Run it with dotnet run repro.cs in mcr.microsoft.com/dotnet/sdk:11.0.

Expected behavior

What .NET 10.0.15 prints in the same container:

.NET 10.0.15
Ubuntu 26.04.1 LTS
GetUtcOffset(DateTimeOffset) = 11:00:00
GetUtcOffset(DateTime, Utc)  = 11:00:00
IsDaylightSavingTime         = True
ConvertTime                  = 2038-01-01T00:00:00.0000000+11:00
ConvertTimeFromUtc           = 2038-01-01T00:00:00.0000000

Offset changes, 2037-01-01 to 2040-01-01 (UTC instant: old -> new)
  2037-04-04 15:00Z: 11:00:00 -> 10:30:00
  2037-10-03 15:30Z: 10:30:00 -> 11:00:00
  2038-04-03 15:00Z: 11:00:00 -> 10:30:00
  2038-10-02 15:30Z: 10:30:00 -> 11:00:00
  2039-04-02 15:00Z: 11:00:00 -> 10:30:00
  2039-10-01 15:30Z: 10:30:00 -> 11:00:00

Actual behavior

.NET 11.0.0
Ubuntu 26.04.1 LTS
GetUtcOffset(DateTimeOffset) = 10:30:00
GetUtcOffset(DateTime, Utc)  = 10:30:00
IsDaylightSavingTime         = False
ConvertTime                  = 2037-12-31T23:30:00.0000000+10:30
ConvertTimeFromUtc           = 2037-12-31T23:30:00.0000000

Offset changes, 2037-01-01 to 2040-01-01 (UTC instant: old -> new)
  2037-04-04 15:00Z: 11:00:00 -> 10:30:00
  2037-10-03 15:30Z: 10:30:00 -> 11:00:00
  2037-12-31 13:00Z: 11:00:00 -> 10:30:00
  2038-01-01 00:00Z: 10:30:00 -> 11:00:00
  2038-04-03 15:00Z: 11:00:00 -> 10:30:00
  2038-10-02 15:30Z: 10:30:00 -> 11:00:00
  2039-04-02 15:00Z: 11:00:00 -> 10:30:00
  2039-10-01 15:30Z: 10:30:00 -> 11:00:00

The two extra lines are the bug: standard time from local midnight to UTC midnight on 2038-01-01.

Regression?

Yes, from .NET 10. 10.0.15 is correct and 11.0.0 is wrong, on the same machine and the same tzdata files.

Known Workarounds

None found.

Configuration

  • .NET 11.0.0 (SDK 11.0.100) in mcr.microsoft.com/dotnet/sdk:11.0: Ubuntu 26.04.1, x64, tzdata 2026e-0ubuntu0.26.04.1. The zone file is "fat" TZif: explicit transitions through 2037, then the POSIX rule <+1030>-10:30<+11>-11,M10.1.0,M4.1.0.
  • .NET 10.0.15 for the comparison, installed into the same container with dotnet-install.sh --channel 10.0 --runtime dotnet.
  • Windows 11 x64 with .NET 11.0.0 gives the correct result.

Other information

Scope. I compared GetUtcOffset and IsDaylightSavingTime between 10.0.15 and 11.0.0 for every system zone on that image (419), hourly from 1970 through 2045, and every 30 minutes from 2035 through 2040.

With the stock tzdata, 12 zones differ:

  • 11 show this pattern, each from its local midnight to UTC midnight on 2038-01-01: Antarctica/Macquarie, Antarctica/McMurdo, Australia/Adelaide, Australia/Broken_Hill, Australia/Hobart, Australia/Lord_Howe, Australia/Melbourne, Australia/Sydney, Pacific/Auckland, Pacific/Chatham, Pacific/Norfolk. All are east of UTC and in daylight time over the New Year.
  • Africa/Cairo ends daylight time in 2037 a day early (2037-10-28 21:00Z instead of 2037-10-29 21:00Z). .NET 10 is a day early in the same way from 2038 on, so this looks like the existing handling of a POSIX rule with a 24:00 time (M10.5.4/24), now starting a year sooner. I didn't look further.
  • Europe/London and America/New_York are identical on both runtimes for the whole range.

With the same tzdata recompiled as slim TZif (zic -b slim), 14 zones differ, and by more than hours:

  • Australia/Sydney, Melbourne, Adelaide, Broken_Hill and Lord_Howe lose both 2008 transitions, so daylight time runs from April to October 2008;
  • America/Santiago and Pacific/Easter lose both 2023 transitions;
  • Pacific/Norfolk starts daylight time on 2020-01-01 instead of 2019-10-05, and Europe/Dublin loses both 1996 transitions;
  • the local-midnight-to-UTC-midnight window appears at an earlier New Year, for example 2007/2008 for Pacific/Auckland.

Ubuntu 26.04, Debian 13, Alpine 3.24, Fedora 45 and Azure Linux 3 all ship fat files, so I have only seen the slim results with files I compiled myself.

GetUtcOffset and ConvertTime never disagreed with each other in either scan.

Suspected cause. This is from reading the code, not from a debugger. CacheTransitionsForYear in TimeZoneInfo.Cache.cs, which came with #119662, caches year 2037 by walking the per-transition rules and then reaching the rule built from the POSIX string. That rule's DateStart is the last explicit transition, 2037-10-03 15:30Z, so this line picks 2037 rather than 2038:

int nextYear = Math.Min(year + 1, nextRule.DateStart.Year);

nextYearEnd is then the April 2037 transition, which is already behind the last cached transition. In the branch for a rule whose daylight time spans the New Year, daylight time is added only up to nextBeginningOfYearUtc (local 2038-01-01 00:00, which is 2037-12-31 13:00Z), the transition up to nextYearEndUtc is skipped, and the rest of the UTC year is filled with a non-daylight transition.

That matches the observed window exactly, and it would explain why only zones east of UTC are affected: for a zone west of UTC, local midnight comes after UTC midnight, so there is nothing left to fill.

TimeZoneInfo.Cache.cs is identical on main and release/11.0 today.

Activity

  1. added
    untriaged
    on Nov 16, 2026
  2. dotnet-policy-service commented on Nov 16, 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. tarekgh commented on Nov 16, 2026

    @tarekgh
    Member

    Thanks @lahma for your report, we'll take a look.

  4. removed
    untriaged
    on Nov 16, 2026
  5. added this to the 12.0.0 milestone on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions