Skip to content

TimeZoneInfo bug changes offset twice within 1 hour #81672

Open
@clement911

Description

@clement911

Description

For some timezones, at specific times, the UTC offset behaves illogically.

Reproduction Steps

With .NET 7

var utc = DateTimeOffset.Parse("2014-12-31T14:30:00Z");
var tz = TimeZoneInfo.FindSystemTimeZoneById("North Korea Standard Time");
Console.WriteLine(TimeZoneInfo.ConvertTime(utc, tz));
Console.WriteLine(TimeZoneInfo.ConvertTime(utc.AddMinutes(30), tz));
Console.WriteLine(TimeZoneInfo.ConvertTime(utc.AddMinutes(60), tz));
Console.Read();

Expected behavior

The utc offset shouldn't change twice within the span of hour

Actual behavior

The utc offset changes twice within the span of hour

Output:

31/12/2014 11:30:00 PM +09:00
31/12/2014 11:30:00 PM +08:30
1/01/2015 12:30:00 AM +09:00

Regression?

Not sure

Known Workarounds

No response

Configuration

.NET 7, windows 11

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions