Search This Blog

Thursday, 13 July 2017

How to set manual date in linux command

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


[root@ip-172-31-6-98 ec2-user]# ls

dgc_linux_5_0_3-FINAL.sh

[root@ip-172-31-6-98 ec2-user]# rm -rf dgc_linux_5_0_3-FINAL.sh

[root@ip-172-31-6-98 ec2-user]# date

Fri Jul 7 02:36:45 EDT 2017

[root@ip-172-31-6-98 ec2-user]# date --set="6 Jul 2017 02:37:30"

Thu Jul 6 02:37:30 EDT 2017

[root@ip-172-31-6-98 ec2-user]# date

Thu Jul 6 02:37:34 EDT 2017

[root@ip-172-31-6-98 ec2-user]# datehwclock -r

bash: datehwclock: command not found

[root@ip-172-31-6-98 ec2-user]# hwclock -r

Friday 07 July 2017 02:41:59 AM EDT -0.508323 seconds

[root@ip-172-31-6-98 ec2-user]# ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

[root@ip-172-31-6-98 ec2-user]# date

Thu Jul 6 02:43:42 EDT 2017

[root@ip-172-31-6-98 ec2-user]#

No comments:

Post a Comment