Slackware: Setting the Clock

Created: 2022-10-02

Current as of Slackware 15.0.

  1. Select a timezone (or UTC) with timeconfig (this is the same dialog that asks you "HARDWARE CLOCK SET TO UTC?" when you first install Slackware via the standard setup script.)

  2. Get accurate time for your timezone via NTP with ntpdate.

  3. View and set the hardware clock with hwclock.

Here’s what the whole process looks like (clock was exactly four hours off because it was set to UTC time rather than my local timezone (despite showing the -04:00 timezone!)).

~$ hwclock
2022-10-02 14:03:11.391654-04:00
~$ sudo -i
# timeconfig
    | graphical  |
    | TUI dialog |
    | to select  |
    | timezone   |
# ntpdate
# hwclock --systohc
# hwclock
2022-10-02 10:04:46.990025-04:00
# exit
~$ date
Sun Oct  2 10:04:59 EDT 2022

You can easily examine the Slackware timeconfig script to see what it’s doing since it’s a shell script:

less /usr/sbin/timeconfig