How to set up time date manually in Arch Linux
sudo timedatectl set-ntp true
timedatectl set-timezone UTC
- Both time and date :
date -s "19 APR 2012 11:14:00"
- Only date :
date +%Y%m%d -s "20120418"
- Only time :
date +%T -s "11:14:00"
- To set manually :
# timedatectl set-time "YYYY-MM-DD HH:MM:SS"
# timedatectl set-time "2013-01-08 18:18:18"
# timedatectl status
If the local time and UTC is different try with command line below:
timedatectl set-timezone UTC
- To set automatically using ntp:
# pacman -S ntp
# ntpd -qg
then Check using timedatectl status. When using ntpd -qg your system must be connected on internet, to get time date from server.
- Setting Hardware Clock :
The hardware clock is the clock that runs in you PC hardware even if you disconnect it from the main power supply. This is because it has a lithium battery in the modern computers and another type of battery in the old ones.
We’ll see differences between hardware clock and system clock.
hardware clock…
hwclock --show
Will output something like this:
(Thu 19 Apr 2012 03:23:05 PM BOT -0.785086 seconds)
system clock…
date
Will output something like this:
(Thu Apr 19 15:26:41 BOT 2012)
- To set the hardware clock to local time:
hwclock --set --date="2012-04-19 16:45:05" --localtime
- If you want to set it to UTC time use:
hwclock --set --date="2011-04-19 20:45:05" --utc
- To set the timezone of your system clock do the following:
cp /usr/share/zoneinfo/America/La_Paz /etc/localtime