[
Contents]
[
Prev]
[
Next]
[
Index]
[
Report an Error]
Setting a Custom Time Zone
You can update the time zone database information on JUNOS routers
independently of the JUNOS operating system. This feature simplifies
time zone management in JUNOS systems by allowing for future unforeseen
time zone database adjustments. You can configure your router to use
a custom time zone database file that you create to meet your requirements
by editing an existing time zone database file.
Usage Guidelines for Setting 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. Compile the time zone archive using
the zic time zone compiler, which generates tz files.
- Using the CLI, configure the router to enable the
use of the generated tz files as follows:
- [edit]
# set system use-imported-timezones
- If the above setting is made, the following
command will show the imported time zones (saved in the directory
/var/db/zoneinfo/):
Otherwise, the JUNOS default time zones are shown
(saved in the directory /usr/share/zoneinfo/).
How to Import and Install Time Zone Files
To import and install time zone files, follow these steps:
- Download the time zone files archive and untar
them to a tmp directory:
- # mkdir -p /var/tmp/tz && cd /var/tmp/tz && rm *
# wget 'ftp://elsie.nci.nih.gov/pub/tzdata*.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.sh
 |
Note:
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 generate northamerica and asia 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:
- [edit]
# set system time-zone <your-time-zone>
# commit
- Verify that the time zone change has
taken effect:
- [edit]
# run show system uptime
[
Contents]
[
Prev]
[
Next]
[
Index]
[
Report an Error]