Linux Timezones – How to List Timezones Known to the System

linuxtimezone

I would like to have a list of all the timezones in my system's zoneinfo database (note : system is a debian strecth linux)

The current solution I have is : list all paths under /usr/share/zoneinfo/posix, which are either plain files or symlinks

cd /usr/share/zoneinfo/posix && find * -type f -or -type l | sort

I am not sure, however, that each and every known timezone is mapped to a path under this directory.

Question

Is there a command which gives the complete list of timezones in the system's current zoneinfo database ?

Best Answer

On Debian 9, your command gave me all of the timezones listed here: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Additionally, systemd provides timedatectl list-timezones, which outputs a list identical to your command.

As far as I know, the data in tzdata is provided directly from IANA:

This package contains data required for the implementation of
 standard local time for many representative locations around the
 globe. It is updated periodically to reflect changes made by
 political bodies to time zone boundaries, UTC offsets, and
 daylight-saving rules.

So just keep the tzdata package updated.

Related Question