Supported Platforms
Related Documentation
- M, MX, PTX, QFX, T Series
- Modifying the Default Time Zone for a Router or Switch Running Junos OS
- NTP Time Server and Time Services Overview
- M, MX, PTX, T Series
- NTP Overview
- M, MX, QFX, T Series
- Example: Configuring NTP as a Single Time Source for Router and Switch Clock Synchronization
- M, MX, PTX, SRX, T Series
- use-imported-time-zones
Setting a Custom Time Zone on Routers or Switches Running Junos OS
You can update the time zone database information on routers or switches running Junos OS. This feature simplifies time zone management in devices running Junos OS by allowing for future unforeseen time zone database adjustments. You can configure your router or switch to use a custom time zone database file that you create to meet your requirements by editing an existing time zone database file.
Tasks for setting a custom time zone are:
Importing and Installing Time Zone Files
To import and install time zone files, follow these steps:
- Download the time zone files archive and untar them to
a temporary directory such as
/var/tmp
:# mkdir -p /var/tmp/tz && cd /var/tmp/tz && rm *
# wget 'ftp://ftp.iana.org/tz/tzdata-latest.tar.gz'
# tar xvzf tzdata*.gz
africa
antarctica
asia
australasia
europe
northamerica
southamerica
pacificnew
etcetera
factory
backward
systemv
solar87
solar88
solar89
iso3166.tab
zone.tab
leapseconds
yearistype.shNote: If needed, you can edit the above untarred files to create or modify time zones.
- Select the names of time zone files to compile and feed
them to the following script.
For example, to generatenorthamerica
andasia
tz files:# /usr/libexec/ui/compile-tz northamerica asia
- Enable the use of the generated tz files using the CLI:
[edit]
# set system use-imported-time-zones
[edit]
# set system time-zone ?This should show the newly generated tz files in
/var/db/zoneinfo/
. - Set the time zone and commit the configuration:
[edit]
# set system time-zone <your-time-zone>
# commit - Verify that the time zone change has taken effect:
[edit]
# 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:
[edit]
user@host# set system use-imported-time-zones -
Display the imported time zones (saved in the directory
/var/db/zoneinfo/
):[edit]
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
/usr/share/zoneinfo/
).
Related Documentation
- M, MX, PTX, QFX, T Series
- Modifying the Default Time Zone for a Router or Switch Running Junos OS
- NTP Time Server and Time Services Overview
- M, MX, PTX, T Series
- NTP Overview
- M, MX, QFX, T Series
- Example: Configuring NTP as a Single Time Source for Router and Switch Clock Synchronization
- M, MX, PTX, SRX, T Series
- use-imported-time-zones
Published: 2013-01-23
Supported Platforms
Related Documentation
- M, MX, PTX, QFX, T Series
- Modifying the Default Time Zone for a Router or Switch Running Junos OS
- NTP Time Server and Time Services Overview
- M, MX, PTX, T Series
- NTP Overview
- M, MX, QFX, T Series
- Example: Configuring NTP as a Single Time Source for Router and Switch Clock Synchronization
- M, MX, PTX, SRX, T Series
- use-imported-time-zones