Nothing To Lose

If you don’t have it, how can you lose it!
Subscribe

Archive for April 27th, 2009

Setting date on Linux through the command line

April 27, 2009 By: Dexter Category: BASH, Linux, Linux Commands

It has always been said the setting the date through the command line is tough.  Well I found it very very simple.

By default date command displays the current system date and time.

To set the system date and time you can use the - -set option  with the date string.  Of course to do that you will need root access.

( - - set ( hyphen hyphen set) without spaces. some browsers combine the two hyphens)

ie.  date  - -set=’dd/mm/yyyy hh:mm:ss’

or

date  - -set=’27/04/2009 20:10:05′

that should set your date :)

[end]