mattjohnsonpint / TimeZoneNames

Provides a complete source of localized time zone names and abbreviations.
MIT License
199 stars 32 forks source link

Library inconsistency under Linux #62

Closed xlegalles closed 3 years ago

xlegalles commented 3 years ago

Reproducible steps This code works fine under Windows 10 (.NET Core 2.2) but not under Ubuntu:

var can = TZConvert.TryGetTimeZoneInfo("Europe/Paris", out var timeZone);
if (can)
{
       Console.WriteLine($"TZ  Europe/Paris into IANA {TZConvert.WindowsToIana(timeZone.Id)}");
}

Current result

Unhandled Exception: System.InvalidTimeZoneException: "Europe/Paris" was not recognized as a valid Windows time zone ID.
   at TimeZoneConverter.TZConvert.WindowsToIana(String windowsTimeZoneId, String territoryCode)

Any idea?

xlegalles commented 3 years ago

This bug is related to TimeZoneConverter and not to this library