• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Thursday, June 12, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
163
VIEWS
Share on FacebookShare on Twitter

Contents

  1. How to Find and Set Local Timezone in Linux
  2. How to Set Time and Date in Linux
    1. Set Time in Linux
    2. Set Date in Linux
  3. How to Find and Set Hardware Clock in Linux
  4. Synchronizing Linux System Clock with a Remote NTP Server
  5. Summary

The timedatectl command is a new utility for RHEL/CentOS 7 and Fedora 21+ based distributions, which comes as a part of systemd system and service manager, a replacement for old traditional date command used in sysvinit daemon based Linux distributions.

How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Use timedatectl to Set System Time, Date and Timezone in Linux

The timedatectl command allows you to query and change the configuration of the system clock and its settings, you can use this command to set or change the current date, time and timezone or enable automatic system clock synchronization with a remote NTP server.

In this tutorial, am going to take you through the ways you can manage time on your Linux system by setting the date, time, timezone and synchronize time with NTP from the terminal using new timedatectl command.

It is always a good practice to maintain the correct time on your Linux server or system and it can have the following advantages:

  1. maintain a timely operation of system tasks since most tasks in Linux are controlled by time.
  2. correct time for logging events and other information on the system and many more.

How to Find and Set Local Timezone in Linux

1. To display the current time and date on your system, use the timedatectl command from the commandline as follows:

# timedatectl  status
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Check Time and Date

In the scrrentcast above, RTC time: is the hardware clock time.

2. The time on your Linux system is always managed through the timezone set on the system, to view your current timezone, do it as follows:

# timedatectl 
OR
# timedatectl | grep Time
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Check Linux Time Zone

3. To view all available timezones, run the command below:

# timedatectl list-timezones
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

List All Timezones in Linux

4. To find the local timezone according to your location, run the following command:

# timedatectl list-timezones |  egrep  -o “Asia/B.*”
# timedatectl list-timezones |  egrep  -o “Europe/L.*”
# timedatectl list-timezones |  egrep  -o “America/N.*”
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Find Local Timezone in Linux

5. To set your local timezone in Linux, we will use set-timezone switch as shown below.

# timedatectl set-timezone “Asia/Kolkata”
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set Local Timezone in Linux

It is always recommended to use and set the coordinated universal time, UTC.

# timedatectl set-timezone UTC
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set UTC Time in Linux

You need to type the correct name timezone other wise you may get errors when changing the timezone, in the following example, the timezone “Asia/Kalkata” is not correct therefore causing the error.

How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set Correct Timezone in Linux

How to Set Time and Date in Linux

6. You can set the date and time on your system, using the timedatectl command as follows:

Set Time in Linux

To set time only, we can use set-time switch along the format of time in HH:MM:SS (Hour, Minute and Seconds).

# timedatectl set-time 15:58:30
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set Local Time in Linux

Set Date in Linux

7. To set date only, we can use set-time switch along the format of date in YY:MM:DD (Year, Month, Day).

# timedatectl set-time 20151120
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set Date in Linux

8. To set both date and time:

# timedatectl set-time '2015-11-20 16:14:50'
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set Date and Time in Linux

How to Find and Set Hardware Clock in Linux

9. To set your hardware clock to coordinated universal time, UTC, use the set-local-rtc boolean-value option as follows:

First Find out if your hardware clock is set to local timezone:

# timedatectl | grep local

Set your hardware clock to local timezone:

# timedatectl set-local-rtc 1
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set Hardware Clock Timezone

Set your hardware clock to coordinated universal time (UTC):

# timedatectl set-local-rtc 0
How to Set Time, Timezone and Synchronize System Clock Using timedatectl Command

Set Hardware Clock to UTC

Synchronizing Linux System Clock with a Remote NTP Server

NTP stands for Network Time Protocol is a internet protocol, which is used to synchronize system clock between computers. The timedatectl utility enables you to automatically sync your Linux system clock with a remote group of servers using NTP.

Please note that, you must have NTP installed on the system to enable automatic time synchronization with NTP servers.

To start automatic time synchronization with remote NTP server, type the following command at the terminal.

# timedatectl set-ntp true

To disable NTP time synchronization, type the following command at the terminal.

# timedatectl set-ntp false

Summary

These are very easy examples described in this tutorial and I hope you will find them helpful for setting various Linux system clocks and timezones. To learn more about this tool, head over to timedatectl man page.

If you have anything to say about this article, feel free to leave a comment for any more information to add. Stay connected to Tecmint.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

Kurly – An Alternative to Most Widely Used Curl Program

Next Post

10 sFTP Command Examples to Transfer Files on Remote Servers in Linux

Next Post

10 sFTP Command Examples to Transfer Files on Remote Servers in Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In