Updating the IANA Time Zone Database on Junos OS Devices
Junos OS devices use the tz database, also known as the IANA Time Zone Database to manage time zones. This database is periodically updated by IANA to reflect political and time changes. As such, you may need from time to time to update this file to ensure the Junos devices continue to accurately reflect worldwide time zones and daylight savings time intervals.
To update the IANA Time Zone Database, perform the following steps:
Importing and Installing Time Zone Files
The IANA Time Zone Database is maintained by the Internet Assigned Numbers Authority (IANA), which is a department of the Internet Corporation for Assigned Names and Numbers (ICANN). You can download the latest IANA Time Zone Database file from the following URL: http://www.iana.org/time-zones.
The following steps will guide you through one method of installing the file to your device. However, depending on your network access and other preferences, you may need to modify these steps.
- Log into the Junos device.
- If you are in the CLI interface, open the shell interface.device@user# start shell
- Create a tz directory in the /var/tmp and navigate to that directory.# mkdir /var/tmp/tz# cd /var/tmp/tz
- Using FTP, download the time zone files archive.
FTP must be enabled on your device before you can use FTP. FTP is enabled by adding the ftp statement into the [edit system services] hierarchy.# ftp ftp.iana.org/tz# bin# get tzdata-latest.tar.gz
If needed, you can edit the above untarred files to create or modify the time zones.
- Select the names of time zone files to compile and feed
them to the following script.
For example, to generate
# /usr/libexec/ui/compile-tz northamerica asia
- Enable the use of the generated tz files using the CLI:
# set system use-imported-time-zones
# set system time-zone ?
This should show the newly generated tz files in
- Set the time zone and commit the configuration:
# set system time-zone <your-time-zone>
- Verify that the time zone change has taken effect:
# run show system uptime
Configuring a Custom Time Zone
To use a custom time zone, follow these steps:
- Download a time zones archive (from a known or designated source) to the router or switch. Compile the time zone archive using the zic time zone compiler, which generates tz files.
- Using the CLI, configure the router or switch to enable
the use of the generated tz files as follows:
user@host# set system use-imported-time-zones
Display the imported time zones (saved in the directory
user@host# set system time-zone ?
If you do not configure the router to use imported time zones, the Junos OS default time zones are shown (saved in the directory