Enter your email address:

Delivered by FeedBurner

feedburner count

How To Change The Date and Time on Linux


Changing the date and time from the Linux Desktop is very easy. Usually all you need to do is right click on the Desktop clock and choose Adjust Date & Time. In case we are using a non GUI environment like Ububtu server we need to use the command line for that.

Using the Linux date command to display the current date and time

If we want to view the current date and time using a command line all we need to do is to execute the Linux date command:

$ date
Thu Jul 10 08:37:02 BST 2008

We can see that the date is the 10th of July 2008 ,the time is 8:37 and the time zone is the British summer time.
We can view the universal time using the -u option

$ date -u
Thu Jul 10 07:37:02 UTC 2008

Changing the date and time in Linux using the date command

If we want to change the date and time we can use the same command with the addition of the new date and/or time

$ date 071009372008.00

In this example I added another hour to the time.

The date format is MMDDhhmmYYYY.ss
  • MM - Two digits for the month
  • DD - Two digits for the day
  • hh - Two digits for the hour
  • mm - Two digits for the minute
  • YYYY - Four digits for the year
  • .ss - Two digits for the seconds
The new time is according to the system time zone.

Changing the time zone in Ubuntu Linux is very easy and can be done with another command.


Post a Comment