< Home

clock daylight-saving-time

Function

The clock daylight-saving-time command configures the time zone name, start time, and end time for daylight saving time.

The undo clock daylight-saving-time command deletes the start time and end time of the daylight saving time.

By default, the start time and end time of the daylight saving time are not configured.

Format

clock daylight-saving-time time-zone-name one-year start-time start-date end-time end-date offset

clock daylight-saving-time time-zone-name repeating repeat-start-time { start-weekday day-in-start-week start-month | repeat-start-date } repeat-end-time { end-weekday day-in-end-week end-month | repeat-end-date } offset [ start-year [ end-year ] ]

undo clock daylight-saving-time

Parameters

Parameter Description Value
time-zone-name Specifies the name of the daylight saving time zone. The value is a string of 1 to 32 case-sensitive characters without spaces.
one-year Indicates the absolute daylight saving time. -
start-time Specifies the start time. The time format is HH:MM using a 24-hour clock. HH specifies the hour, ranging from 0 to 23; MM specifies the minute, ranging from 0 to 59. If MM is not specified, its value is set to 0. You must enter at least one digit to specify HH. For example, if you enter 0, the start time is 00:00:00.
start-date Specifies the start date. The date format is YYYY-MM-DD. The value of YYYY ranges from 2000 to 2099; the value of MM ranges from 1 to 12; the value of DD ranges from 1 to 31.
end-time Specifies the end time. The time format is HH:MM and uses a 24-hour clock. HH specifies the hour, ranging from 0 to 23; MM specifies the minute, ranging from 0 to 59. If MM is not specified, its value is set to 0. You must enter at least one digit to specify HH. For example, if you enter 0, the end time is 00:00:00.
end-date Specifies the end date. The date format is YYYY-MM-DD. The value of YYYY ranges from 2000 to 2099; the value of MM ranges from 1 to 12; the value of DD ranges from 1 to 31.
repeating Indicates the periodic daylight saving time. -
repeat-start-time Specifies the start time. The time format is HH:MM using a 24-hour clock. HH specifies the hour, ranging from 0 to 23; MM specifies the minute, ranging from 0 to 59. If MM is not specified, its value is set to 0. You must enter at least one digit to specify HH. For example, if you enter 0, the start time is 00:00:00.
start-weekday Specifies the start week.
  • first: starts from the first week.
  • second: starts from the second week.
  • third: starts from the third week.
  • fourth: starts from the fourth week.
  • last: starts from the last week.
day-in-start-week Specifies the start working day. The value can be Mon, Tue, Wed, Thu, Fri, Sat, and Sun.
start-month Specifies the start month. The value can be Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec.
repeat-start-date Specifies the start date. The date format is MM-DD. The value of MM ranges from 1 to 12; the value of DD ranges from 1 to 31.
repeat-end-time Specifies the end time. The time format is HH:MM and uses a 24-hour clock. HH specifies the hour, ranging from 0 to 23; MM specifies the minute, ranging from 0 to 59. If MM is not specified, its value is set to 0. You must enter at least one digit to specify HH. For example, if you enter 0, the end time is 00:00:00.
end-weekday Specifies the end week.
  • first: ends at the first week.
  • second: ends at the second week.
  • third: ends at the third week.
  • fourth: ends at the fourth week.
  • last: ends at the last week.
day-in-end-week Specifies the end working day. The value can be Mon, Tue, Wed, Thu, Fri, Sat, and Sun.
end-month Specifies the end month. The value can be Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, and Dec.
repeat-end-date Specifies the end date. The date format is MM-DD. The value of MM ranges from 1 to 12; the value of DD ranges from 1 to 31.
offset Specifies the time added to or deleted from the daylight saving time. The format for this value is HH:MM, in 24-hour notation. HH specifies the hour, ranging from 0 to 23; MM specifies the minute, ranging from 0 to 59. If MM is not specified, the value is 0. You must enter at least one digit number to specify HH. The value of the offset ranges from 1 to 120, in minutes.
start-year Specifies the start year. The year format is YYYY. The value of YYYY ranges from 2000 to 2099.
end-year Specifies the end year. The year format is YYYY. The value of YYYY ranges from 2000 to 2099.

Views

User view, System view

Default Level

3: Management level

Usage Guidelines

Usage Scenario

Daylight Saving Time (DST), also referred to as summer time, is a convention established by people for saving resources. In high latitude areas, it is earlier in summer than in winter at sunrise. To reduce evening usage of incandescent lighting and save energy, clocks are adjusted forward one hour. At present, about 110 countries adopt DST all over the world.

Users can customize the DST zone according to their countries' or regions' convention. In addition, users can set how long clocks are adjusted forward, usually an hour. With DST enabled, when it is time to start DST, the system time is adjusted according to user-specified DST; when it is time to end DST, the system time automatically returns to original time.

Configuration Impact

If you need to configure daylight saving time, note the following:
  • The time shown in messages such as logs and debugging information will use configured daylight saving time.
  • Output for the display command shows time for the local time zone and will be adjusted to show configured daylight saving time.
If you must remove configurations for daylight saving time, note the following:
  • If daylight saving time is in effect when you remove the configurations, the device will adjust its clock based on the value of the offset parameter.
  • If daylight saving time is not in effect, removing the configurations will not affect system time.

Follow-up Procedure

You can run the display clock command to view detailed information about the system time after daylight saving time takes effect.

Precautions

  • DST is configured in the summer. The DST duration ranges from one day to one year.
  • You can configure the start time and end time for daylight saving time in one of the following modes: date+date, week+week, date+week, and week+date.
  • After you run the clock daylight-saving-time 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.

Example

# Set the daylight saving time based on weeks.
<sysname> system-view
[sysname] clock daylight-saving-time bj repeating 0 first Sun Jan 0 first Sun Apr 2 2009 2009
# Set the daylight saving time based on days.
<sysname> system-view
[sysname] clock daylight-saving-time bj repeating 12:11 1-1 1:0 3-4 1
# Set daylight saving time for one year with no repeat.
<sysname> system-view
[sysname] clock daylight-saving-time bj one-year 12:11 2010-10-2 1:00 2010-11-4 1
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >