< Home

clock timezone

Function

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.

Format

clock timezone time-zone-name { add | minus } offset

undo clock timezone

Parameters

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
  • HH specifies the hour.
    • If the local time is earlier than the UTC, the value is an integer ranging from 0 to 14.
    • If the local time is later than the UTC, the value is an integer ranging from 0 to 12.
  • MM and SS specify the minute and second respectively, and both range from 0 to 59.
  • When HH is set to the maximum value, the MM and SS values must be 0.

Views

User view, System view

Default Level

3: Management level

Usage Guidelines

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

System time adjustment may affect the timing restart function. If you must adjust the system time after the timing restart function is enabled, pay attention to the impact of system time adjustment on the timing restart function:
  • If the system time is changed to less than 10 minutes after the scheduled restart time, the system restarts immediately.
  • If the system time is changed to 10 minutes or more after the scheduled restart time, the timing restart function is disabled.
  • If the system time is changed to 720 hours earlier than the scheduled restart time, the timing restart function is disabled.

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.

Example

# Set the local time zone name for Beijing China to BJ.

If the default UTC is London time 2012-12-01 00:00:00, Beijing time is London time plus 08:00 because the offset from UTC is 8 hours.

<HUAWEI> clock datetime 0:0:0 2012-12-01
<HUAWEI> system-view
[HUAWEI] clock timezone BJ add 08:00:00
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >