question: failed to find timezone 'Asia/Shanghai' in time zone database #160
-
Summary Now I think jiff will get timezone info with TimeZone::get() accross Line 235 in a44e494
But actually, I get err:
And in Chrono's Tz parse, it's ok. Looks like it generate a tzfile. And I try to println tz::db().available(), it's empty. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 7 replies
-
Maybe I missed some key configuration? |
Beta Was this translation helpful? Give feedback.
-
This docker image not support tzdata. $ docker pull summerwind/actions-runner-dind:v2.320.0-ubuntu-22.04
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
summerwind/actions-runner-dind v2.320.0-ubuntu-22.04 4da10987fec9 4 weeks ago 1.22GB
$ docker run -it 4da10987fec9 /bin/bash
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
runner@6510b467a532:/$ ls /usr/share/zoneinfo
ls: cannot access '/usr/share/zoneinfo': No such file or directory
runner@6510b467a532:/$
exit
So that means if I want to use jiff crate, must install tzdata first ? |
Beta Was this translation helpful? Give feedback.
-
Is it by design? Why we need it? |
Beta Was this translation helpful? Give feedback.
-
As a practical matter, if you enable logging, Jiff is should emit very detailed log messages about what's going wrong when it comes to system integration stuff. That probably would have saved you some head-scratching.
As a conceptual matter, think about it: every time zone has its own rules for transitions. How does your code know what they are? On Unix systems, the standard way to do this is with tzdb at
Otherwise, the platform documentation goes to great pains to try and explain everything here. Your specific situation is even explicitly mentioned!
|
Beta Was this translation helpful? Give feedback.
As a practical matter, if you enable logging, Jiff is should emit very detailed log messages about what's going wrong when it comes to system integration stuff. That probably would have saved you some head-scratching.
As a conceptual matter, think about it: every time zone has its own rules for transitions. How does your code know what they are?
On Unix systems, the standard way to do this is with tzdb at
/usr/share/zoneinfo
. In your case, installing it into your Docker image should fix your problem. This is the preferred approach.chrono-tz
doesn't need this because it bundles all of the data into your Rust program. Jiff supports this too, and you can e…