System Time Configuration
show clock
Section titled “show clock”[Command]
show clock
[Purpose]
Display time zone and time
[View]
System view
[Use Cases]
sonic# show clock[Command]
show supported-timezones
[Purpose]
Display the time zones supported by the system configuration
[View]
System view
[Use Cases]
sonic# show supported-timezonesclock datetime
Section titled “clock datetime”[Command]
clock datetime date_string time_string
[Purpose]
Configure system time
[Parameter]
| Parameter | Description |
|---|---|
| date_string | Date value, YY-MM-DD format |
| time_string | Time value, HH:MM:SS format |
[View]
System configuration view
[Usage Scenario]
When preparing to deploy a device, it’s essential to configure the system time of the device to the current actual time. This ensures that the device’s logs and alarm messages accurately reflect the timestamp of events. The device often comes with an arbitrary system time when it leaves the factory, which doesn’t represent the actual time.
[Use Cases]
sonic# configuresonic(config)# clock datetime 2022-02-22 20:30:30clock timezone
Section titled “clock timezone”[Command]
clock timezone zone
no clock timezone
[Purpose]
Configure the system time zone, the default time zone is UTC
[Parameter]
| Parameter | Description |
|---|---|
| zone | Timezone |
[View]
System view
[Use Cases]
sonic# configuresonic(config)# clock timezone Asia/Shang