The time-range command sets a time range to describe a certain period of time.
The undo time-range command deletes a time range.
By default, no time range is configured.
Parameter | Description | Value |
---|---|---|
time-name |
Specifies a time range name. |
The value is a string of 1 to 32 case-sensitive characters, spaces not supported. The name must start with an uppercase or lowercase letter. In addition, the word all cannot be specified as a time range name. |
time1 |
Specifies the start time of a time range. |
The value is in the format of hh:mm. hh stands for hour, and the value of hh ranges from 0 to 23. mm stands for minute, and the value of mm ranges from 0 to 59. If the parameter is configured more than once, all configurations take effect. |
to time2 |
Specifies the end time of a time range. |
The value is in the format of hh:mm. hh stands for hour, and the value of hh ranges from 0 to 23. mm stands for minute, and the value of mm ranges from 0 to 59. If the parameter is configured more than once, all configurations take effect. |
to time2 date2 |
Specifies a time on a day when a time range ends. The end time must be later than the start time. |
The value of time-date1 is in the format of hh:mm. hh stands for hour, and the value of hh ranges from 0 to 23. mm stands for minute, and the value of mm ranges from 0 to 59. time-date2 is in the format of YYYY/MM/DD. DD stands for day, and its value is an integer ranging from 1 to 31. MM stands for month, and its value is an integer ranging from 1 to 12. YYYY stands for year, and its value is an integer ranging from 2000 to 2037.
|
days |
Specifies the days in a week when a time range takes effect. |
The value can be set to any of the following:
|
from time1 date1 |
Specifies a time on a day when a time range starts. |
The value of time-date1 is in the format of hh:mm. hh stands for hour, and the value of hh ranges from 0 to 23. mm stands for minute, and the value of mm ranges from 0 to 59. time-date2 is in the format of YYYY/MM/DD. DD stands for day, and its value is an integer ranging from 1 to 31. MM stands for month, and its value is an integer ranging from 1 to 12. YYYY stands for year, and its value is an integer ranging from 2000 to 2037. If the parameter is configured more than once, all configurations take effect. |
Usage Scenario
When certain services or functions need to take effect at a specified time or during a specified period, run the time-range command to set a time range as required. When a time range takes effect or expired, a configuration change event is generated and the configuration change log is recorded.
A maximum of 256 time ranges can be configured. A maximum of 32 relative time ranges and 12 absolute time ranges can share one time range name.
Usually, absolute and relative time ranges are used together. An absolute time range defines a time range, and a relative time range specifies the day in a week when the defined time range takes effect.
Follow-up Procedure
Run the rule command with time-range configured to set a validity period for an ACL.
Precautions
Multiple time ranges that share one name can be set to specify a time range. Time ranges under the same name can be set based on the following principles:
The configured time range cannot be earlier than the current time. Otherwise, the time range does not take effect.
You can configure a time range instance without specifying a relative or absolute time range. For example, you can configure a time range instance aa using the time-range aa command. If a relative or absolute time range that needs to be deleted is the last record of a time range instance, the time range instance is deleted synchronously. For example, when you delete a time range record using the undo time-range aa 12:00 to 18:00 daily command, the time range instance aa is deleted synchronously if the time range to be deleted is the last record of the instance.
<HUAWEI> system-view [~HUAWEI] time-range test from 0:0 2009/1/1
<HUAWEI> system-view [~HUAWEI] time-range test from 08:30 2013/1/1 to 18:00 2013/12/31
<HUAWEI> system-view [~HUAWEI] time-range test 8:00 to 18:00 working-day
<HUAWEI> system-view [~HUAWEI] time-range test 14:00 to 18:00 off-day