User Tools

Site Tools


linux:ntp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux:ntp [2020/09/28 14:41] – created bstaffordlinux:ntp [2022/11/23 12:49] (current) – external edit 127.0.0.1
Line 3: Line 3:
  
 Show time and timezones Show time and timezones
-</code>sudo timedatectl</code>+<code>sudo timedatectl</code>
 List available timezones List available timezones
-</code>sudo timedatectl list-timezones</code>+<code>sudo timedatectl list-timezones</code>
 Set timezone Set timezone
-</code>sudo timedatectl set-timezone Europe/London</code>+<code>sudo timedatectl set-timezone Europe/London</code> 
 +To view the current time and date, run the following command. 
 +<code>date</code> 
 +To set the time manually, use the following command (substitute letters to numbers as appropriate). 
 +<code>date MMDDhhmmYYYY</code> 
 +To tell the machine to sync with a time server to get the latest time, use the following command. 
 +<code>ntpdate pool.ntp.org</code> 
 +The time daeomon on CentOS is called ntpd. To install the ntpd daemon, run the following as root. 
 +<code>yum -y install ntpd</code> 
 +To ensure it runs on start up, run the following as root. 
 +<code>chkconfig ntpd on</code> 
 +To manually start ntpd, run the following as root. 
 +<code>service ntpd start</code> 
 +If the machine is a Linux VM in VirtualBox running on a Windows host and you want to set the time to some date in the future, you will need to prevent the VM automatically correcting the time. Shut the VM down and run this command in the Windows host. 
 +<code>vboxmanage setextradata MACHINENAME "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"</code>
linux/ntp.1601304089.txt.gz · Last modified: (external edit)