In CentOS
timezones are located in /usr/share/zoneinfo/
, to change the system date to a specific timezone you can:
First, make a backup of the existing localtime file.
sudo mv /etc/localtime /etc/localtime.bak
Next, create the link:
sudo ln -s /usr/share/zoneinfo/Europe/Lisbon /etc/localtime
Check the new system date by typing date
.
To adjust the Linux system date manually you can type:
date -s "11 MAR 2006 11:11:11"
OR
date --set="11 MAR 2015 11:11:11"
OR
date +%Y%m%d -s "20150311"
To set the Hardware Clock to the current System Time:
hwclock --systohc
OR
hwclock -w
1
A quick search of Google returns this link: > http://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/
– None – 2011-06-26T13:26:55.693