https://kerneltalks.com/commands/date-time-management-using-timedatectl-command
In our previous article we have seen how to change timezone of Linux server using files or variables in system. Few of our readers pushed
In this article, we will see how to display server time details, view, list and change timezone of server using
In the output these are the fields :
You
will be presented with list of available timezones in paged manner. You
can use any of thee timezones to set on your local system. To change
timezone of your system use
Above command will change server timezone to Australia/Sydney one.
If NTP is configured then you might see error
Please
note that enabling NTP here does not take you through NTP configuration
steps. That has to be done separately . This only controls if system
should sync time using configured NTP or not.
Thats all switchs which are mainly useful for you in day today operations. There are few more which can be referred from its man page.
Learn timezone management using
timedatectl command. Article explaining different uses of timedatectl
command along with examples.
In our previous article we have seen how to change timezone of Linux server using files or variables in system. Few of our readers pushed
timedatectl
command to achieve this task easily. So I thought of writing separate article on timedatectl
command explaining all its usage.In this article, we will see how to display server time details, view, list and change timezone of server using
timedatectl
command.timedatectl
is Time Date Control command! It used to control date and time of
server in Linux. To check your current system date and time details, run
this command without any switch –Local time
: Your system’s local date and timeUniversal time
: Current UTC timeRTC time
: Current Real time clock timeTime zone
: Your system’s current timezoneNTP enabled
: Is NTP is enabled on system or notNTP synchronized
: NTP time synced or not.RTC in local TZ
: Is RTC maintaining in configured system TZ? It is recommended to keep it off.DST active
: Daylight saving time enabled or notList and change timezone using timedatectl
timedatectl
allow you to change timezone of system with list of available timezones. To view list of available timezones use command with list-timezones
switch.set-timezone
switch.Change date and time using timedatectl
Most of the servers are configured with NTP these days. But if not and/or if you want to change date and time manually then you can useset-time
switch. Time should be supplied with YYYY-MM-DD HH:MM:SSFailed to set time: Automatic time synchronization is enabled
when attempting to change system time manually.Enable/Disable RTC and NTP using timedatectl
You cn enable or disable RTC (Real Time Clock) and NTP usingtimedatectl
. For RTC use set-local-rtc
and for NTP use set-ntp
switch. Both arguments accepts 1 (to enable) and 0 (to disable) as values.Manage date and time of other machine
You can usetimedatectl
command to manage date and time of local containers or remote machines. To manage time of local container use -M
switch whereas to connect to remote host and manage its time use -H
switch.-M
switch takes argument as --host=ip/hostname
. -H
switch takes argument as --machine=container_name
.Thats all switchs which are mainly useful for you in day today operations. There are few more which can be referred from its man page.
No comments:
Post a Comment