Date and Time
Date and Time Configuration
MocaccinoOS uses systemd to manage the system clock, date, time zone and network time synchronization.
The timedatectl command provides a convenient way to configure and manage these settings.
Checking the current date and time
To display the current system time, time zone and synchronization status, run:
|
|
The output includes:
- Local time
- Universal Coordinated Time (UTC)
- Hardware Real-Time Clock (RTC)
- Configured time zone
- System clock synchronization status
- Network Time Protocol (NTP) status
Configuring the time zone
To list all available time zones:
|
|
You can also filter the list. For example:
|
|
To configure the time zone, use set-timezone.
For example, to configure the Netherlands:
|
|
You can verify the configuration by running:
|
|
Enabling automatic time synchronization (NTP)
It is recommended to enable network time synchronization so that your system clock stays accurate automatically.
To enable NTP synchronization:
|
|
This enables and starts the first available network time synchronization service.
To check the synchronization status:
|
|
You can also check the status of the time synchronization service:
|
|
The latter command provides additional information when systemd-timesyncd is being used.
To disable automatic time synchronization:
|
|
Manually setting the system date and time
If you need to configure the system clock manually, first disable automatic time synchronization:
|
|
You can then set the date and time using the following format:
|
|
The format is:
|
|
Once configured, you can verify the new date and time:
|
|
If you want to resume automatic synchronization afterwards:
|
|
Hardware clock (RTC)
The hardware clock, also known as the Real-Time Clock (RTC), is usually located on the motherboard. It keeps track of time even when the computer is powered off.
Linux systems generally use UTC for the hardware clock and apply the configured time zone when displaying local time.
This is the recommended configuration and is also the default for most Linux installations.
To check the hardware clock configuration:
|
|
Look for the RTC in local TZ entry. Ideally, it should report:
|
|
To configure the hardware clock to use UTC:
|
|
Using UTC avoids problems with time zone changes and daylight saving time.
Note: Using local time for the hardware clock is generally discouraged. It may be necessary in certain dual-boot configurations, particularly when another operating system expects the hardware clock to use local time.
Additional information
For more information about timedatectl, consult its manual page:
|
|
You can also consult the following resources: