2016-01-03 12:45:57 +00:00
|
|
|
# timedatectl
|
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
> Control the system time and date.
|
2021-10-03 23:31:41 +01:00
|
|
|
> More information: <https://manned.org/timedatectl>.
|
2016-01-03 12:45:57 +00:00
|
|
|
|
2018-11-21 09:20:43 +00:00
|
|
|
- Check the current system clock time:
|
2016-01-03 12:45:57 +00:00
|
|
|
|
|
|
|
`timedatectl`
|
|
|
|
|
2018-11-21 09:20:43 +00:00
|
|
|
- Set the local time of the system clock directly:
|
2016-01-03 12:45:57 +00:00
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`timedatectl set-time "{{yyyy-MM-dd hh:mm:ss}}"`
|
2016-01-03 12:45:57 +00:00
|
|
|
|
2018-11-21 09:20:43 +00:00
|
|
|
- List available timezones:
|
2016-01-03 12:45:57 +00:00
|
|
|
|
|
|
|
`timedatectl list-timezones`
|
|
|
|
|
2018-11-21 09:20:43 +00:00
|
|
|
- Set the system timezone:
|
2016-01-03 12:45:57 +00:00
|
|
|
|
|
|
|
`timedatectl set-timezone {{timezone}}`
|
2016-04-19 11:58:09 +01:00
|
|
|
|
2018-11-21 09:20:43 +00:00
|
|
|
- Enable Network Time Protocol (NTP) synchronization:
|
2016-04-19 11:58:09 +01:00
|
|
|
|
|
|
|
`timedatectl set-ntp on`
|
2022-10-01 20:24:12 +01:00
|
|
|
|
|
|
|
- Change the hardware clock time standard to localtime:
|
|
|
|
|
|
|
|
`timedatectl set-local-rtc 1`
|