The clock daylight-saving-time command sets the name, start time, and end time of the daylight saving time (DST).
The undo clock daylight-saving-time command cancels the DST settings.
By default, DST is not used.
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 start-time { { first | second | third | fourth | last } weekday month | start-date1 } end-time { { first | second | third | fourth | last } weekday month | end-date1 } offset [ start-year [ end-year ] ]
undo clock daylight-saving-time
Parameter |
Description |
Value |
---|---|---|
time-zone-name | Specifies the name of the DST zone. | The value is a string of 1 to 32 case-sensitive characters without spaces. |
one-year | Specifies absolute DST. | - |
repeating | Specifies periodic DST. | - |
start-time | Specifies the DST start time. | The start time is in 24-hour format HH:MM. HH specifies the hour, which is an integer ranging from 0 to 23. MM specifies the minute, which is an integer ranging from 0 to 59. If MM is not specified, DST starts on the hour. You must enter at least one digit to specify HH. For example, when you enter 0, the start time is 00:00. |
start-date | Specifies the DST start date. | The start date is in the format YYYY-MM-DD. YYYY specifies the year, which is an integer ranging from 2000 to 2099, MM specifies the month, which is an integer ranging from 1 to 12, and DD specifies the day, which is an integer ranging from 1 to 31. |
end-time | Specifies the DST end time. | The end time is in 24-hour format HH:MM. HH specifies the hour, which is an integer ranging from 0 to 23. MM specifies the minute, which is an integer ranging from 0 to 59. If MM is not specified, DST starts on the hour. You must enter at least one digit to specify HH. For example, when you enter 0, the start time is 00:00. |
end-date | Specifies the DST end date. | The end date is in the format YYYY-MM-DD. YYYY specifies the year, which is an integer ranging from 2000 to 2099, MM specifies the month, which is an integer ranging from 1 to 12, and DD specifies the day, which is an integer ranging from 1 to 31. |
first | Specifies the first workday in a month. | - |
second | Specifies the second workday in a month. | - |
third | Specifies the third workday in a month. | - |
fourth | indicates the fourth workday in a month. | - |
last | Specifies the last workday in a month. | - |
weekday | Specifies a day of the week. | The value is Mon, Tue, Wed, Thu, Fri, Sat, or Sun. |
month | Specifies a month. | The value is Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, or Dec. |
start-date1 | Specifies the DST start date. | The start date is in the format MM-DD. MM specifies the month, which is an integer ranging from 1 to 12, and DD specifies the day, which is an integer ranging from 1 to 31. |
end-date1 | Specifies the DST end date. | The end date is in the format MM-DD. MM specifies the month, which is an integer ranging from 1 to 12, and DD specifies the day, which is an integer ranging from 1 to 31. |
offset | Specifies the DST offset. | The offset is in 24-hour format HH:MM. HH specifies the hour, which is an integer ranging from 0 to 23. MM specifies the minute, which is an integer ranging from 0 to 59. If MM is not specified, the offset is the specified hours. You must enter at least one digit to specify HH. |
start-year | Specifies the start year. | The start year is in the format YYYY and ranges from 2000 to 2099. |
end-year | Specifies the end year. | The end year is in the format YYYY and ranges from 2000 to 2099. |
Usage Scenario
DST, also referred to as summer time, is a convention intended to save resources. In high latitude areas, sunrise time is earlier during summer than it is during winter. To reduce use of incandescent lighting in the evenings and save energy, clocks are adjusted forward one hour.
Users can customize the DST zone according to their countries' or regions' convention. In addition, users can set how far ahead clocks are adjusted forward, usually an hour. With DST enabled, when it is time to start DST, the system time is adjusted according to the user-specified DST. When it is time to end DST, the system time automatically returns to the original time.
Configuration Impact
Precautions
The 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 periodic DST in one of the following modes: date+date, week+week, date+week, and week+date.
When 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.
<HUAWEI> system-view [HUAWEI] clock daylight-saving-time bj repeating 0 first sun jan 0 first sun apr 2 2009 2009
<HUAWEI> system-view [HUAWEI] clock daylight-saving-time bj repeating 12:11 1-1 1:0 3-4 1
<HUAWEI> system-view [HUAWEI] clock daylight-saving-time bj one-year 12:11 2010-10-2 1:00 2010-11-4 1