timedatectl

Last Updated : Jul 19, 2021 |
Log in as root or sroot to use the following command.
Prolog information
Allows you to change the current time, current date and the time-zone of the AE Services server.
The following list provides the syntax of each functionality:
  • Syntax to change the current time
    timedatectl set-time HH:MM:SS
    where
    HH represents two-digit hour
    MM represents two-digit minute
    SS represents two-digit second
    Note:
    timedatectl command updates the system clock and the hardware clock. However, the command fails if the chronyd service is enabled on the system.
  • Syntax to change the current date
    timedatectl set-time YYYY:MM:DD
    where
    YYYY represents four-digit year
    MM represents two-digit month
    DD represents two-digit day of the month
    Note:
    Changing the date without specifying the current time results in setting the time to 00:00:00.
  • Syntax to change the current time-zone
    timedatectl set-timezone time_zone
    where time_zone represents the timezones from timedatectl list-timezones command.
Note:
For more information, see Red Hat Enterprise Linux (RHEL) operating system documentation.