The clock timezone command sets the local time zone.
The undo clock timezone command deletes the local time zone.
By default, the system uses the Coordinated Universal Time (UTC) time zone.
Parameter |
Description |
Value |
---|---|---|
time-zone-name |
Specifies the time zone name. |
The name is a string of 1 to 32 case-sensitive characters without spaces. |
add |
Specifies the offset from the UTC for the time zone specified by time-zone-name. That is, the sum of the default UTC time zone and offset is equal to the time zone specified by time-zone-name. |
- |
minus |
Specifies the offset from the UTC for the time zone specified by time-zone-name. That is, the remainder obtained by subtracting offset from the default UTC time zone is equal to the time zone specified by time-zone-name. |
- |
offset |
Specifies the offset from the UTC. |
Format: HH:MM:SS
|
Usage Scenario
The system clock is the time indicated by the system timestamp. Because the rules governing local time differ in different regions, the system clock can be configured to comply with the rules of any given region.
System clock = UTC + Time zone offset + DST offset
To ensure normal communication between devices, set an accurate system clock. You can run the clock timezone and clock daylight-saving-time commands to set the time zone and DST offsets.
Configuration Impact
Precautions
The specified time must be in 24-hour format. If you do not specify MM and SS, their values are 0. You must enter at least one digit to specify HH. For example, when you enter 0, the time is 00:00:00.
After configuring the local time zone, run the display clock command to view the configuration. The time in logs and diagnostic information uses the local time adjusted based on the time zone and DST.
When you run the clock timezone command in either the user or system view, the configuration files are both generated in the system view. You are advised to run this command in the system view.
Executing the clock timezone command takes about 3 seconds.