• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 516
  • Last Modified:

set time on linux

How do I set the time on linux?  If I type "date" it returns the wrong time.  I did a man on "date", but didn't see a way to change the time.


  • 2
1 Solution
It may depend on which flavor of Unix you are using, but on Linux :

linux:~ # date -s '3/19/2002 15:10:30'
Tue Mar 19 15:10:30 EST 2002

On Aix :

aix:~ # date 0217142590
This sets the date and time to Sat Feb 17 14:25:00 CST 1990.

Are you sure "man date" didn't give you this information?
Setting the date/time using the "date" command doesn't necessarily adjust the system clock, so when you reboot the machine you might very well have the wrong date/time again.

Try "man hwclock".
lphillips120898Author Commented:
I actually had to use a combination of both of these to accomplish what I wanted... i.e. set the time now and have it "stick" upon reboot.  I would like to split the points.

I still have one slight problem... one of the boxes shows EST and the other PST when I do "date".  How can I change this to be EST?
man timeconfig
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now