
zdump: Print Timezone Information
zdump is a small utility that prints the current time for a given timezone or a detailed view of a timezone’s transitions. It’s handy when you want to verify how a TZ file is interpreted by your system.
Quick examples
- Print the current time in a specific timezone:
zdump /usr/share/zoneinfo/Europe/London
- Show verbose information about all transitions for a timezone (useful for debugging DST changes):
zdump -v /usr/share/zoneinfo/America/New_York
- Print the current time for the system’s default timezone (often implied by its path):
zdump /etc/localtime
- Display help and options:
zdump --help
Note: zdump reads the timezone data from the tzdata files (typically under /usr/share/zoneinfo). The path you pass determines which timezone’s data is used.
Practical usage tips
- Use absolute paths to timezone data to avoid ambiguity. For example, /usr/share/zoneinfo/America/Los_Angeles.
- For scripting, parse the output to build logs that include local time context for events in different zones.
- If you see unexpected times, verify that your tzdata package is up to date and that your system is using the intended timezone file.
Common pitfalls
- Passing a non-existent file: zdump will print an error if the timezone file cannot be found.
- Example:
bash zdump /usr/share/zoneinfo/Invalid/Zone
- Example:
- Relying on /etc/localtime as a portable source: while convenient, /etc/localtime is a symlink or copy to a zone file; always reference the canonical path under /usr/share/zoneinfo when debugging.
- Assuming all TZ changes are reflected immediately: some systems cache timezone data; ensure tzdata is updated and services are restarted if needed.
When to use verbose output (-v)
- To inspect all transitions and the exact times DST starts/ends for a zone:
zdump -v /usr/share/zoneinfo/America/Denver
- Useful for cross-checking historical times and ensuring your applications interpret times correctly.
Quick reference
- Print current time for a zone:
- zdump /usr/share/zoneinfo/Region/Zone
- Verbose transitions:
- zdump -v /usr/share/zoneinfo/Region/Zone
- Help:
- zdump —help