3.2.2. Changing the Time
To change the current time, run the following command as root
:
date +%T -s HH:MM:SS
…where
HH stands for an hour,
MM is a minute, and
SS is a second, all typed in a two-digit form. If your system clock is set to use
UTC (Coordinated Universal Time), also add the following option:
date +%T -s HH:MM:SS -u
For instance, to set the system clock to 11:26 PM using the
UTC, type:
~]# date +%T -s 23:26:00 -u
You can verify the current settings by running date
without any additional argument. You should not use this command to set the time if the system clock is being maintained by chrony, ntpd
, or any other similar automated process.