• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How To Configure Time using timedatectl command

{{postValue.id}}

To Configure Time using timedatectl command

Configuring Timezone, Time and System Clock Synchronization using timedatectl Command in linux is explained in this article.

Find and Set Local Timezone in Linux

To display the current date and time on your system, utilize the following command in the commandline.


\[root@linuxhelp~\] # timedatectl  status

current date and time

Here, RTC time is the hardware clock time.
To view the present timezone, run the following command.


\[root@linuxhelp~\] # timedatectl 
OR
\[root@linuxhelp~\] # timedatectl | grep Time

present time

Execute the below command inorder to view all available timezones.


\[root@linuxhelp~\] # timedatectl list-timezones

available timezones
Execute the below command to find the local timezone in your location.


\[root@linuxhelp~\] # timedatectl list-timezones |  egrep  -o &ldquo Asia/B.\*&rdquo 
\[root@linuxhelp~\] # timedatectl list-timezones |  egrep  -o &ldquo Asia/K.\*&rdquo 

snap4

Utilize set-timezone for setting your local timezone in Linux.


\[root@linuxhelp~\] # timedatectl set-timezone &ldquo Asia/Kolkata&rdquo 
\[root@linuxhelp~\] # timedatectl

set timezone

The coordinated universal time, UTC is mostly recommended.


\[root@linuxhelp~\] # timedatectl set-timezone UTC
\[root@linuxhelp~\] # timedatectl

universal time

While modifying the timezone, you have to type the correct name of the timezone, or else you will get an error.
modified time zone

Setting Date and Time in Linux

Utilize the set-time with the format of time in HH:MM:SS (Hour, Minute and Seconds).


\[root@linuxhelp~\] # timedatectl set-time 12:30:30 
\[root@linuxhelp~\] # timedatectl

set time format

Utilize the set-time with the format of date in YY:MM:DD (Year, Month, Day).


\[root@linuxhelp~\] # timedatectl set-time 2016-11-20
\[root@linuxhelp~\] # timedatectl

time format

For setting both time and date utilize the following command.


\[root@linuxhelp~\] # timedatectl set-time ' 2016-11-20 19:08:14' 
\[root@linuxhelp~\] # timedatectl

time and date setup

To Find and Set Hardware Clock in Linux

Utilize the set-local-rtc boolean-value option to check whether your hardware clock is in local timezone.


\[root@linuxhelp~\] # timedatectl | grep local

To Set the hardware clock to local timezone


\[root@linuxhelp~\] # timedatectl set-local-rtc 1
\[root@linuxhelp~\] # timedatectl

hardware clock

To Set the hardware clock to coordinate universal time (UTC)


\[root@linuxhelp~\] # timedatectl set-local-rtc 0
\[root@linuxhelp~\] # timedatectl

UTC

Utilize the below command for Synchronisation with a Remote NTP Server


\[root@linuxhelp~\] # timedatectl set-ntp true
\[root@linuxhelp~\] # timedatectl

remote NTP server

Utilize the following command for disabling NTP time synchronisation.


\[root@linuxhelp~\] # timedatectl set-ntp false
\[root@linuxhelp~\] # timedatectl

NTP time synchroninsation

Tags:
ethan
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Has the timedatectl software been tested for edge cases, eg UTC+13 ?

A

you can simply set the local timezone at UTC+13 timezone.

Q

Does the timesyncd.conf file have to be edited after running, timedatectl set-ntp true ?

A

Default the internet cluster of ntp servers will be used. Unless you want to use the specified servers in /etc/systemd/timesyncd.conf, you can leave the time servers commented out.

Q

I want NTP to be synced? How to enable that

A

Please set "timedatectl set-ntp true" as true in order to NTP.

Q

Which port does NTP use?

A

NTP uses port 123.

Q

Is NTP UDP or TCP?

A

NTP time servers work within the TCP/IP suite and rely on User Datagram Protocol (UDP) port 123.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help keel johnston ?
Unhide the folders on windows Explorer

Give any solutions to unhide folder using command prompt?

forum3

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.