Solved

set time on linux

Posted on 2002-03-19
4
493 Views
Last Modified: 2010-04-21
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.

Thanks,

Lisa
0
Comment
Question by:lphillips120898
  • 2
4 Comments
 
LVL 1

Expert Comment

by:smisk
ID: 6880766
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?
0
 
LVL 1

Expert Comment

by:Sixpax
ID: 6881094
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".
0
 

Author Comment

by:lphillips120898
ID: 6882659
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?
0
 
LVL 1

Accepted Solution

by:
Sixpax earned 100 total points
ID: 6885935
man timeconfig
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question