TimeZones.jl icon indicating copy to clipboard operation
TimeZones.jl copied to clipboard

The time zone "Europe/Amsterdam" is of class `TimeZones.Class(:LEGACY)`

Open rikhuijzer opened this issue 1 year ago • 2 comments

I'm unable to run code which refers to tz"Europe/Amsterdam" with TimeZones.jl v1.9.1:

julia> using TimeZones

julia> tz"Europe/Amsterdam"
ERROR: LoadError: ArgumentError: The time zone "Europe/Amsterdam" is of class `TimeZones.Class(:LEGACY)` which is currently not allowed by the mask: `TimeZones.Class(:FIXED) | TimeZones.Class(:STANDARD)`
Stacktrace:
 [1] TimeZone(str::String, mask::TimeZones.Class)
   @ TimeZones ~/.julia/packages/TimeZones/V28u7/src/types/timezone.jl:89
 [2] TimeZone(str::String)
   @ TimeZones ~/.julia/packages/TimeZones/V28u7/src/types/timezone.jl:70
 [3] var"@tz_str"(__source__::LineNumberNode, __module__::Module, str::Any)
   @ TimeZones ~/.julia/packages/TimeZones/V28u7/src/types/timezone.jl:110
in expression starting at REPL[7]:1

This is unexpected since Europe/Amsterdam is a commonly used timezone. The release notes of tz show no mention of the deprecation of the timezone, apart from the following note:

Finish moving to 'backzone' the location-based zones whose timestamps since 1970 are duplicates; adjust links accordingly. This change ordinarily affects only pre-1970 timestamps, and with the new PACKRATLIST option it does not affect any timestamps. In this round the affected zones are Antarctica/Vostok, Asia/Brunei, Asia/Kuala_Lumpur, Atlantic/Reykjavik, Europe/Amsterdam, Europe/Copenhagen, Europe/Luxembourg, Europe/Monaco, Europe/Oslo, Europe/Stockholm, Indian/Christmas, Indian/Cocos, Indian/Kerguelen, Indian/Mahe, Indian/Reunion, Pacific/Chuuk, Pacific/Funafuti, Pacific/Majuro, Pacific/Pohnpei, Pacific/Wake and Pacific/Wallis, and the affected links are Arctic/Longyearbyen, Atlantic/Jan_Mayen, Iceland, Pacific/Ponape, Pacific/Truk, and Pacific/Yap.

source: https://github.com/eggert/tz/blob/16ce126a87c5f130cde8b8dce73b38952a19f085/NEWS#L300-L312

And indeed the same error shows up for the zones listed in the note. For example:

julia> tz"Pacific/Ponape"
ERROR: LoadError: ArgumentError: The time zone "Pacific/Ponape" is of class `TimeZones.Class(:LEGACY)` which is currently not allowed by the mask: `TimeZones.Class(:FIXED) | TimeZones.Class(:STANDARD)`
Stacktrace:
 [1] TimeZone(str::String, mask::TimeZones.Class)
   @ TimeZones ~/.julia/packages/TimeZones/V28u7/src/types/timezone.jl:89
 [2] TimeZone(str::String)
   @ TimeZones ~/.julia/packages/TimeZones/V28u7/src/types/timezone.jl:70
 [3] var"@tz_str"(__source__::LineNumberNode, __module__::Module, str::Any)
   @ TimeZones ~/.julia/packages/TimeZones/V28u7/src/types/timezone.jl:110
in expression starting at REPL[14]:1

Is this behavior expected?

rikhuijzer avatar Dec 02 '22 11:12 rikhuijzer