Friday, October 31, 2014

Set linux date n time

set date and time:
(date --set="YYYYmmdd HH:MM")

date --set="2 OCT 2006 18:00:00"

or

date +%Y%m%d -s "20081128"

set only time:
date +%T -s "10:13:13"


set only year:
date --set="$(date +'2013%m%d %H:%M')"


set hardware clock in line with linux time
hwclock --systohc

or  
hwclock -w

No comments:

Post a Comment