Date Set

July 19, 2011 • Customer Services       
Synopsis

How to set the Date/Time from the command line

Article

In order to set the date/time at the Linux command line, you have to type in a string of digits in the correct order.

I am writing this document at 10:11 local time on February 26th 2009. If I wanted to set a Linux clock to that time I would type :

date 02261011

This string is made up as follows

The 02 is the month. February is the second month. The 26 is the date within the month. The 10 is the hour, 10am in this case. The 11 is the minutes past the hour.

This would normally work unless your clock had been so incorrect that you need to reset the year as well. In this case, you could type

date 022610112009

The last four digits are the year, fully specified.

Related articles


Last modified on Tue, July 19, 2011 « Back