Skip to content
Ask AI

System Time Configuration

[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-timezones

[Command]

clock datetime date_string time_string

[Purpose]

Configure system time

[Parameter]

ParameterDescription
date_stringDate value, YY-MM-DD format
time_stringTime 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# configure
sonic(config)# clock datetime 2022-02-22 20:30:30

[Command]

clock timezone zone

no clock timezone

[Purpose]

Configure the system time zone, the default time zone is UTC

[Parameter]

ParameterDescription
zoneTimezone

[View]

System view

[Use Cases]

sonic# configure
sonic(config)# clock timezone Asia/Shang