How to Change the Time and Date in Linux

Rate this post
How to Change the Time and Date in Linux
How to Change the Time and Date in Linux

Updating the software on your device is a crucial aspect of having a stable and secure system, but having an up-to-current time and date is even more important.

A system with accurate time and date not only gives you the exact time, but also enables you to conduct automatic operations as planned and effortlessly connect to services via the internet.

This post will teach you how to use the timedatectl command to examine, alter, and set the time and date on Linux.

How Time Is Managed on Linux

Linux employs two types of clocks to maintain correct time:

  • A real-time clock (RTC) or hardware clock embedded into the circuit board of your computer that operates independently of the operating system. Even when your operating system is shutting down, restarting, or sleeping, the clock continues to tick.
  • A system clock, sometimes known colloquially as a software clock. The system clock, which is maintained by the Linux kernel, is dependent on the real-time clock to determine its starting time when your Linux OS boots up.

Your system time is preserved in the Universal Coordinated Time (UTC) format by default. The UTC time is then converted by your Linux system to the right local time depending on your area or time zone. The desktop displays the current local time.

  How to Change the Colors and Themes of Your Instagram Chat

Listing Time and Date Information

One of the most crucial things you should be able to do when adjusting the time on Linux is list and examine the current time on your machine.

Simply use the timedatectl command without any arguments to show the time and other setup options:


The command shows the local time of the system, the UTC time, and the real-time clock. The output also includes the time zone and other key time-related data.

How to Adjust the Time on Linux

Use the timedatectl command in conjunction with the set-time subcommand to set or alter the time.

sudo timedatectl set-time hh:mm:ss

To change the time or date, you must have higher rights.

The hh in the preceding command stands for hours, mm for minutes, and ss for seconds. The time you provide must be in 24-hour format.

For example, to change the time to 12 a.m., use the following command:

sudo timedatectl set-time 00:00:00

The command changes the real-time clock as well as the system or software clock. If the Network Time Protocol (NTP) is enabled on your system, you will be unable to modify the time or date.

  How to Recover a Misplaced Apple Pencil

How to Enable/Disable NTP

The Network Time Protocol ensures that your time is synced with a distant server according to your time zone or area.

To disable NTP on Linux, run the following command:

sudo timedatectl set-ntp false

To reactivate or enable NTP, simply run:

sudo timedatectl set-ntp true

When this option is activated, the system will automatically modify and synchronize the time with the server time.

If your system does not support NTP, the set-ntp subcommand will not operate.

How to Set the Date on Linux

To modify the date on your computer, use the timedatectl command with the set-time subcommand as follows:

sudo timedatectl set-date YYYY-MM-DD

…where YYYY represents the year, MM represents the month, and DD represents the day.

To set the date to January 1, 2000, for example, use the following command:

sudo timedatectl set-time "2000-01-01 23:00:01"

We’ve also supplied the time because if you simply supply the date, timedatectl will set the time to 00:00, or 12 midnight.

Changing Your Time Zone

Before you may change the time zone on your PC, you must first understand how to list or see available time zones.

timedatectl list-timezones

Scroll between the timezones shown by pressing the F key on your computer and the B key on your keyboard. Alternatively, you may scroll using the arrow keys.

  6 Microsoft Outlook to Google Calendar Syncing Tools

Once you’ve determined your time zone, you may use the following command to switch to the Africa/Blantyre time zone:

timedatectl set-timezone Africa/Blantyre

Getting Command-Line Help

Run the following command to learn more about timedatectl:

timedatectl help

You may read the command’s man pages for a more in-depth explanation by running:

man timedatectl

Related: Ways to Get Command-Line Help on Linux

Alternative Time Clock Utilities on Linux

This post has taught you how to set the time and date on Linux using the timedatectl program, a powerful and contemporary clock adjustment that is included with the systemd service. The hwclock and date commands are two more basic clock tuning tools in Linux.

You are looking for information, articles, knowledge about the topic How to Change the Time and Date in Linux on internet, you do not find the information you need! Here are the best content compiled and compiled by the team, along with other related topics such as: How To.

Related videos about How to Change the Time and Date in Linux


Similar Posts