TimeZones ERROR: ArgumentError: Unknown time zone "Europe/Warsaw"


I’m trying to use the TimeZones package (JuliaPro 0.6.3, TimeZones 0.7.2 on Ubuntu Linux 18.04). Trying to create a timezone with any argument other than UTC fails. Any suggestions on what I am doing wrong? Thanks!

julia> import TimeZones
INFO: Recompiling stale cache file /home/dara/.juliapro- for module Compat.
INFO: Recompiling stale cache file /home/dara/.juliapro- for module TimeZones.

julia> TimeZones.TimeZone(“UTC”)

julia> TimeZones.TimeZone(“Europe/Warsaw”)
ERROR: ArgumentError: Unknown time zone “Europe/Warsaw”
[1] (::TimeZones.##1#3{String})() at /juliapro/JuliaPro-
[2] get!(::TimeZones.##1#3{String}, ::Dict{AbstractString,Base.Dates.TimeZone}, ::String) at ./dict.jl:449
[3] Base.Dates.TimeZone(::String) at /juliapro/JuliaPro-

julia> TimeZones.timezone_names()
ERROR: SystemError: unable to read directory /juliapro/JuliaPro- No such file or directory
[1] readdir(::String) at ./file.jl:415
[2] timezone_names() at /juliapro/JuliaPro-


Europe/Warsaw is not the name of a time zone. See this list for time zones and their abbreviations:

Actually it is:

“Europe/Warsaw” is the very first example in TimeZones’s documentation: https://timezonesjl.readthedocs.io/en/stable/types/

@dhazeghi Maybe you need to build the package first:


Thanks @StefanKarpinski and @giordano - that does the trick! I must’ve messed up the installation some time ago because if I do Pkg.rm() and Pkg.add(), everything appears to be fine.

(In the process of testing, I also discovered that some of the timezones that the Linux ‘date’ command reports e.g. ‘PST’ are not actually recognized by the system as valid timezones - Ubuntu 18.04 only has ‘PST8PDT’. Yuck)

Not sure I deserve any thanks on this one—my only contribution was misinformation :grimacing: