set date
Syntax
set date (date-time | ntp <ntp-server> <key authentication-key number> <servers> <source-address source-address>)
Description
Set the date and time.
user@host> set date ntp 21 Apr 17:22:02 ntpdate[3867]: step time server 172.17.27.46 offset 8.759252 sec
Options
-
date-time
—Specify date and time in one of the following formats:-
YYYYMMDDHHMM.SS
-
“month DD, YYYY HH:MM(am | pm)”
Note:In Junos OS Evolved, the date and time will be set only on the node where the command is issued.
-
ntp
—Configure the router to synchronize the current date and time setting with a Network Time Protocol (NTP) server.Note:In Junos OS Evolved, if the ntpd server is running, the
set date ntp
command fails with the following error message:error: ntpd is already running
. To use this command, you must first stop the ntpd serverntp-server
—(Optional) Specify the IP address of one or more NTP servers.key authentication-key number
—(Optional) Specify a key number to authenticate the NTP server used to synchronize the date and time. You must specify the same key number used to authenticate the server configured at the[edit system ntp authentication-key number
] hierarchy level.-
servers
—(Optional) Specify the IP address of one or more NTP servers. source-address
source-address
—(Optional) Specify the source address that is used by the router to contact the remote NTP server.
Required Privilege Level
view
Sample Output
set date ntp (Junos OS)
user@host> set date ntp 22 Jun 10:07:48 ntpdate[51123]: step time server 66.129.255.62 offset -0.013200 sec
set date ntp (Junos OS Evolved)
user@host> set date ntp ------------------------------- node: re0 ------------------------------- error: ntpd is already running
Release Information
Command introduced before Junos OS Release 7.4.
key
option introduced in Junos OS Release 12.1R2