Set time on Raspberry Pi
sudo timedatectl set-time '2018-10-02 09:53'
date -s "2 OCT 2006 18:00:00"
timedatectl set-time 04:00:00
sudo timedatectl set-time 04:00:00
sudo timedatectl set-ntp false
sudo timedatectl set-time 04:00:00
sudo timedatectl
timedatectl set-ntp yes
yum install ntp ntpdate
# systemctl start ntpd
# systemctl enable ntpd
# systemctl status ntpd
# ntpdate -u -s 0.centos.pool.ntp.org 1.centos.pool.ntp.org 2.centos.pool.ntp.org
Next, restart the ntpd daemon to synchronize CentOS NTP server date and time with your local date and time.
# systemctl restart ntpd
Now check using the timedatectl command if NTP synchronization is enabled and if it is actually synchronized.
# timedatectl
Lastly, using the hwclock utility, set the hardware clock to the current system time using the -w flag as follows.
# hwclock -w
timedatectl list-timezones
tzselect
You can make this change permanent for yourself by appending the line
TZ='Asia/Singapore'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Singapore
date -s "2 OCT 2006 18:00:00"
timedatectl set-time 04:00:00
sudo timedatectl set-time 04:00:00
sudo timedatectl set-ntp false
sudo timedatectl set-time 04:00:00
sudo timedatectl
timedatectl set-ntp yes
yum install ntp ntpdate
# systemctl start ntpd
# systemctl enable ntpd
# systemctl status ntpd
# ntpdate -u -s 0.centos.pool.ntp.org 1.centos.pool.ntp.org 2.centos.pool.ntp.org
Next, restart the ntpd daemon to synchronize CentOS NTP server date and time with your local date and time.
# systemctl restart ntpd
Now check using the timedatectl command if NTP synchronization is enabled and if it is actually synchronized.
# timedatectl
Lastly, using the hwclock utility, set the hardware clock to the current system time using the -w flag as follows.
# hwclock -w
timedatectl list-timezones
tzselect
You can make this change permanent for yourself by appending the line
TZ='Asia/Singapore'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Singapore
timedatectl set-timezone Asia/Singapore
## Dora - this solved my problem 2019-07-29 12:20 pm
https://www.raspberrypi.org/forums/viewtopic.php?t=222236 sudo apt install htpdate
Comments
Post a Comment