This topic describes the terms and operations related to time and time zones in Linux operating systems, and describes the changes in clock configurations in some Alibaba Cloud Linux public images.

Background information

The following table describes the terms related to time and time zones in Linux operating systems.
Term Description
clock Linux has the following clocks:
  • Hardware clock, also known as real-time clock (RTC): the battery-powered clock on the physical motherboard, which can be set in Linux BIOS.
  • System clock: the clock in the Linux kernel. When a Linux operating system starts, the hardware clock first reads the settings of the system clock. After that, the system clock runs independently of the physical hardware. All commands and functions in Linux operating systems use the system clock.
time standard Linux has the following time standards:
  • localtime: the time standard based on the local time zone where the operating system resides.
  • Coordinated Universal Time (UTC): a global time standard that is independent of time zones.

Time-related operations

  • Run the following command to view the time settings in the Linux operating system:
    timedatectl status
    A command output similar to the following one is returned. You can view the local time, UTC time, RTC time, and time zone of the Linux operating system. View time settings
  • Run the timedatectl command to set the time standard of the hardware clock.
    • Set the time standard of the hardware clock to localtime:
      timedatectl set-local-rtc 1
      If the time standard of the hardware clock is localtime, you can find that the value of RTC in local TZ in the time settings is yes after you run the timedatectl status command.
    • Set the time standard of the hardware clock to UTC:
      timedatectl set-local-rtc 0
      If the time standard of the hardware clock is UTC, you can find that the value of RTC in local TZ in the time settings is no after you run the timedatectl status command.
Note The /etc/adjtime configuration file is used to synchronize the system clock. When you run the preceding commands, the /etc/adjtime file is automatically updated.

Public images in which the Alibaba Cloud RTC uses the UTC time standard

By default, RTC in Alibaba Cloud public images uses the localtime standard. Note that Alibaba Cloud has changed the localtime standard used by RTC by default to the UTC time standard. In the following public images and their later versions, RTC uses the UTC time standard. For more information about image releases, see the following topics: