Closed sni closed 5 years ago
I've reordered the TZ detection checks (moved the zoneinfo check down) so the date commands will run first.
I'm not so familiar with docker (becoming more so... but not there yet), so I may reevaluate this later, but for now it seems like a safe change.
Sorry for the slow response... I've been extremely occupied with some other things and have not spent much time on Date::Manip development the last 6 months.
Having a docker container which mounts host /etc/localtime into the container /etc/localtime to sync timezone information. Now docker follows the symlink and mounts the hosts localtime (which is CET) onto /usr/share/zoneinfo/UTC ending in a zoneinfo file named UTC but containing CET data.
Linux
date
behaves correctly and tells the correct time, date and zone.Using D::M tells me:
So the time is correct, but the unix timestamp and zone is wrong. I guess looking at the filename instead of the file content is for performance reasons. But on the other hand, those zonefiles are pretty small, so it shouldn't have much of an impact.
Uncommenting this line helps: https://github.com/SBECK-github/Date-Manip/blame/master/lib/Date/Manip/TZ.pm#L108 Since timezone is then correctly detected by
date +%Z
command.Other workaround would be to set $ENV{'TZ'} =
date +%Z
;