You can set the date and time on a device running Junos
OS by using the set date operational mode command:
To enter the date and time locally:
- From operational mode, manually set the date and time.
Because this is an operational-mode command, there is no need
to perform a commit operation.
user@host> set date YYYYMMDDhhmm.ss
For example:
user@host> set date 201307251632
Thu Jul 25 16:32:00 PDT 2013
- Verify the time.
The show system uptime command provides the following
information: current time, last boot time, protocols start time, last
configuration commit time.
user@host> show system uptime
Current time: 2013-07-25 16:33:38 PDT
System booted: 2013-07-11 17:14:25 PDT (1w6d 23:19 ago)
Protocols started: 2013-07-11 17:16:35 PDT (1w6d 23:17 ago)
Last configured: 2013-07-23 12:32:42 PDT (2d 04:00 ago) by user
4:33PM up 13 days, 23:19, 1 user, load averages: 0.00, 0.01, 0.00
You can use the set date command from operational mode to instruct the device to
retrieve the date and time from a configured NTP server. For example:
From operational mode, issue the set date command and specify ntp to retrieve the date and time
from a configured NTP server, or specify ntp ntp-server to retrieve the date and time from the given NTP server.
user@host> set date ntp ntp-server
For example:
user@host> set date ntp
25 Jun 16:38:28 ntpdate[2314]: step time server 192.0.2.1 offset -0.004182 sec