Skip to content

Working with Dates & Times

The most basic way to view and set the datetime is with the date command (see man date).

On systemd-based systems, the timedatectl command is the best way interact with high-level datetime settings.

Examples

sh
$ timedatectl set-timezone Canada/Pacific
$ timedatectl set-timezone UTC
$ timedatectl set-timezone Canada/Pacific
$ timedatectl set-timezone UTC

It is important to note that these commands will alter the timezone, but will not fix incorrect system datetimes or network synchronization issues.

For network synchronization, it's best to not use the timesyncd service provided by systemd and instead used a service like chronyd or ntpd.

ADDITIONAL RESOURCES