Question & Answer
Question
How can I find out what time zone a location is in?
Answer
If you need to find the time zone for an unfamiliar location, you can do this by using Red Hat Linux on the NPS host.
The tool you need is zdump. The zdump utility prints the current time in each zone_name named on the command line. It can be found at /usr/sbin/zdump (which is not in the nz user's path).
The zdump tool relies on the zone_name information in /usr/share/zoneinfo which has the timezone information.
A listing of that directory looks like:
- [nz@npshost zoneinfo]$ ls -lah
total 576K
drwxr-xr-x 21 root root 4.0K Feb 23 2007 .
drwxr-xr-x 241 root root 12K Aug 5 15:08 ..
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Africa
drwxr-xr-x 6 root root 4.0K Feb 23 2007 America
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Antarctica
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Arctic
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Asia
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Atlantic
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Australia
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Brazil
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Canada
-rw-r--r-- 1 root root 755 Mar 17 2006 CET
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Chile
-rw-r--r-- 1 root root 837 Mar 17 2006 CST6CDT
-rw-r--r-- 2 root root 871 Mar 17 2006 Cuba
-rw-r--r-- 1 root root 679 Mar 17 2006 EET
-rw-r--r-- 2 root root 955 Mar 17 2006 Egypt
-rw-r--r-- 2 root root 1.3K Mar 17 2006 Eire
-rw-r--r-- 1 root root 56 Mar 17 2006 EST
-rw-r--r-- 1 root root 837 Mar 17 2006 EST5EDT
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Etc
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Europe
-rw-r--r-- 1 root root 101 Mar 17 2006 Factory
-rw-r--r-- 4 root root 1.3K Mar 17 2006 GB
-rw-r--r-- 4 root root 1.3K Mar 17 2006 GB-Eire
-rw-r--r-- 10 root root 56 Mar 17 2006 GMT
-rw-r--r-- 10 root root 56 Mar 17 2006 GMT0
-rw-r--r-- 10 root root 56 Mar 17 2006 GMT-0
-rw-r--r-- 10 root root 56 Mar 17 2006 GMT+0
-rw-r--r-- 10 root root 56 Mar 17 2006 Greenwich
-rw-r--r-- 2 root root 426 Mar 17 2006 Hongkong
-rw-r--r-- 1 root root 56 Mar 17 2006 HST
-rw-r--r-- 2 root root 429 Mar 17 2006 Iceland
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Indian
-rw-r--r-- 2 root root 630 Mar 17 2006 Iran
-rw-r--r-- 1 root root 4.0K Mar 17 2006 iso3166.tab
-rw-r--r-- 3 root root 803 Mar 17 2006 Israel
-rw-r--r-- 2 root root 185 Mar 17 2006 Jamaica
-rw-r--r-- 2 root root 125 Mar 17 2006 Japan
-rw-r--r-- 2 root root 87 Mar 17 2006 Kwajalein
-rw-r--r-- 2 root root 238 Mar 17 2006 Libya
-rw-r--r-- 1 root root 755 Mar 17 2006 MET
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Mexico
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Mideast
-rw-r--r-- 1 root root 56 Mar 17 2006 MST
-rw-r--r-- 1 root root 837 Mar 17 2006 MST7MDT
-rw-r--r-- 4 root root 877 Mar 17 2006 Navajo
-rw-r--r-- 2 root root 882 Mar 17 2006 NZ
-rw-r--r-- 2 root root 732 Mar 17 2006 NZ-CHAT
drwxr-xr-x 2 root root 4.0K Feb 23 2007 Pacific
-rw-r--r-- 2 root root 976 Mar 17 2006 Poland
-rw-r--r-- 2 root root 1.3K Mar 17 2006 Portugal
drwxr-xr-x 19 root root 4.0K Feb 23 2007 posix
-rw-r--r-- 3 root root 1.3K Mar 17 2006 posixrules
-rw-r--r-- 2 root root 165 Mar 17 2006 PRC
-rw-r--r-- 1 root root 837 Mar 17 2006 PST8PDT
drwxr-xr-x 19 root root 4.0K Feb 23 2007 right
-rw-r--r-- 2 root root 268 Mar 17 2006 ROC
-rw-r--r-- 2 root root 152 Mar 17 2006 ROK
-rw-r--r-- 2 root root 171 Mar 17 2006 Singapore
-rw-r--r-- 3 root root 993 Mar 17 2006 Turkey
-rw-r--r-- 2 root root 56 Mar 17 2006 UCT
-rw-r--r-- 6 root root 56 Mar 17 2006 Universal
drwxr-xr-x 2 root root 4.0K Feb 23 2007 US
-rw-r--r-- 6 root root 56 Mar 17 2006 UTC
-rw-r--r-- 1 root root 679 Mar 17 2006 WET
-rw-r--r-- 2 root root 815 Mar 17 2006 W-SU
-rw-r--r-- 1 root root 18K Mar 17 2006 zone.tab
-rw-r--r-- 6 root root 56 Mar 17 2006 Zulu
Some of the listings above are a directory that has more time zones in it. For example, the US directory contains the following:
- [nz@helios US]$ ls -lah
total 112K
drwxr-xr-x 2 root root 4.0K Feb 23 2007 .
drwxr-xr-x 21 root root 4.0K Feb 23 2007 ..
-rw-r--r-- 2 root root 856 Mar 17 2006 Alaska
-rw-r--r-- 3 root root 858 Mar 17 2006 Aleutian
-rw-r--r-- 2 root root 130 Mar 17 2006 Arizona
-rw-r--r-- 2 root root 1.3K Mar 17 2006 Central
-rw-r--r-- 3 root root 1.3K Mar 17 2006 Eastern
-rw-r--r-- 4 root root 606 Mar 17 2006 East-Indiana
-rw-r--r-- 2 root root 130 Mar 17 2006 Hawaii
-rw-r--r-- 3 root root 869 Mar 17 2006 Indiana-Starke
-rw-r--r-- 2 root root 811 Mar 17 2006 Michigan
-rw-r--r-- 4 root root 877 Mar 17 2006 Mountain
-rw-r--r-- 2 root root 1017 Mar 17 2006 Pacific
-rw-r--r-- 3 root root 125 Mar 17 2006 Samoa
Here are a few examples of using zdump to find various timezones:
- [nz@npshost]$ /usr/sbin/zdump US/Eastern
US/Eastern Mon Aug 31 10:34:12 2009 EDT
[nz@npshost]$ /usr/sbin/zdump US/Central
US/Central Mon Aug 31 09:34:21 2009 CDT
[nz@npshost]$ /usr/sbin/zdump US/Pacific
US/Pacific Mon Aug 31 07:34:31 2009 PDT
[nz@npshost]$ /usr/sbin/zdump US/Arizona
US/Arizona Mon Aug 31 07:34:43 2009 MST
[nz@npshost]$ /usr/sbin/zdump Japan
Japan Mon Aug 31 23:37:36 2009 JST
[nz@npshost]$ /usr/sbin/zdump Israel
Israel Mon Aug 31 17:38:18 2009 IDT
Finally, it is important to note that if your time zone city is in a sub folder under /usr/share/zoneinfo, you must use that syntax with zdump.
For example, if you want the time zone for Riyadh in Saudi Arabia, you must specify the file in the Asia folder or else your results will be incorrect.
Incorrect:
- [nz@npshost Asia]$ /usr/sbin/zdump Riyadh
Riyadh Mon Aug 31 14:53:22 2009 Riyadh
Correct:
- [nz@npshost Asia]$ /usr/sbin/zdump Asia/Riyadh
Asia/Riyadh Mon Aug 31 17:53:50 2009 AST
[{"Product":{"code":"SSULQD","label":"IBM PureData System"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":null,"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"1.0.0","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]
Historical Number
NZ603365
Was this topic helpful?
Document Information
Modified date:
17 October 2019
UID
swg21571318