Pages

Thursday, August 9, 2012

CentOS Set Time By Command Line

Use the commands below to set the date and time on CentOS.


Set date from the command line
date +%Y%m%d -s "20120418"
Set time from the command line
date +%T -s "11:14:00"
 
Let’s set the hardware clock to local time:
hwclock --set --date="2012-04-19 16:45:05" --localtime
 

http://www.garron.me/linux/set-time-date-timezone-ntp-linux-shell-gnome-command-line.html

No comments:

Post a Comment