Change and sychronize Date and Time

 Displaying the Current Date and Time

~]# timedatectl
 
This displays the local and universal time, the currently used time zone, the status of the Network Time Protocol (NTP) configuration, and additional information related to DST. 

Changing the Current Time

 ~]# timedatectl set-time 21:47:36









in above example changing the date HH:MM:SS Hours:Minutes:Seconds we have to use

Changing the Current Date

 ~]# timedatectl set-time 2015-08-24


Changing the Time Zone

 ~]# timedatectl list-timezones
List the avialable time zones using above command


~]#timedatectl set-timezone time_zone
 

Synchronizing the System Clock with a Remote Server

 ~]# timedatectl set-ntp yes
 
Sycronize your system time with NTP Server 

Using the hwclock Command

~]# hwclock

To display current time you can also use above 'hwclock' 

~]#hwclock --set --date "dd mmm yyyy HH:MM"


Either you can set the hardware clock to the current system time by using this command:
~]#hwclock --hctosys
 
you can set the system time from the hardware clock by using the following command:
~]#hwclock --hctosys
 
To set the hardware clock to the current system time and keep the hardware clock in local time, run the following command as root
 ~]# hwclock --systohc --localtime
 
 

 Write your Valuable Comments...........

No comments:

Post a Comment