This section describes how to configure the system time on the CLI.
The administrator can manually set the system time of the device.
UTC indicates the Universal Time Coordinated.
clock datetime HH:MM:SS YYYY-MM-DD
clock timezone time-zone-name { add | minus } offset
If add is configured, the current time is the UTC time plus the time offset. That is, the default UTC time plus offset is equal to the time of time-zone-name.
If minus is configured, the current time is the UTC time minus the time offset. That is, the default UTC time minus offset is equal to the time of time-zone-name.
clock daylight-saving-time time-zone-name one-year start-time start-date end-time end-date offset
or
clock daylight-saving-time time-zone-name repeating start-time { { first | second | third | fourth | last } weekday month | start-date } end-time { { first | second | third | fourth | last } weekday month | end-date } offset [ start-year [ end-year ] ]
During the configuration of the daylight saving time, you can configure the start time and end time in one of the following modes: date+date, week+week, date+week, and week+date. For details, see clock daylight-saving-time.
display clock [ utc ]
The administrator can synchronize the time of the Network Time Protocol (NTP) server as the device system time.
In the example, the FW functions as an NTP client to synchronize time from the NTP server. For details on NTP, see NTP.
system-view
ntp-service source-interface interface-type interface-number [ vpn-instance vpn-instance-name ]
ntp-service unicast-server ip-address [ version number | [ authentication-keyid key-id | autokey ] | source-interface interface-type interface-number | preference | vpn-instance vpn-instance-name | maxpoll max-number | minpoll min-number | burst | iburst | preempt | port port-number ] *
ntp-service unicast-server ipv6 ipv6-address [ [ authentication-keyid key-id | autokey ] | source-interface interface-type interface-number | preference | vpn-instance vpn-instance-name | maxpoll max-number | minpoll min-number | burst | iburst | preempt | port port-number ] *
Step 2 is optional. If source-interface is specified in Step 3, use it preferentially.
ip-address or ipv6-address is the IP address of the NTP server. It can be the IP address of the host rather than a broadcast address, a multicast address, or the IP address of the reference clock.
When the unicast NTP server is specified, the local FW functions as the client automatically. The server needs to be configured with only a primary clock.
During the configuration of the daylight saving time, you can configure the start time and end time in one of the following modes: date+date, week+week, date+week, and week+date. For details, see clock daylight-saving-time.
display clock [ utc ]