Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

red hat linux date problem

In my linux server, the date and time are not the same as the real date and time.
How can I correct it?

My time zone is Hong Kong (HKT).
0
stanleyhuen
Asked:
stanleyhuen
1 Solution
 
RahmathCommented:
Did you used "date" command. if no, use it as the following

     date -s 03/12/2003   in the MM DD YY format. note that if you set the date with this command the time will be resetted. so after that you want to set the time also by,
   
         date -s 04:30:00   Hour : Mins: Secs format

      note that for both we are using the same command and option only the difference is the format ( "/" and ":" ).
0
 
knowsthCommented:
You would first need to set up the timezone correctly (on RedHat use 'timeconfig').  This copies the correct timezone file to /etc/timezone and sets up /etc/sysconfig/clock.

Then you need to run the 'date' command:
        (for today): "date 200303121115"
sets 2003/03/12 11h15.

Once this has been done then you need to synchronise the hardware to the system time.
         hwclock -w
This ensures that whe you power up, that the hardware supplies the right date/time to the system, and that the system knows how to interpret the timezone information.
0
 
CleanupPingCommented:
stanleyhuen:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
TheWeakestLinkCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept comments from knowsth as answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheWeakestLink
EE Cleanup Volunteer
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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