CentOS 5.6 Set Date, Time and Time Zone

How do i set the time zone, time and date in centos?
deklinmAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

savoneCommented:
Follow this guide to change the tmezone:

http://www.redhat.com/advice/tips/timezone.html

As for setting the time and date use the "date" command.

http://unixhelp.ed.ac.uk/CGI/man-cgi?date

example:
date --set="Wed Dec 7 17:50:05"
0
xtermCommented:
If you want to keep your time accurate, use the network time protocol.

  yum install ntp
  ntpdate <ip address of your time server>

Then you can cron it nightly with something like:

  # set clock each day at 2:15AM
  15 2 * * * root /usr/sbin/ntpdate mytimeserver.net 1>/dev/null
0
deklinmAuthor Commented:
I cannot get the time zone to update.  It keeps coming up 7 hours off.  How can I fix that?
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

xtermCommented:
What specifically are you using to show the time on the machine - the "date" command?
0
xtermCommented:
And make sure that /etc/sysconfig/clock looks good, something like this:


ZONE="America/Chicago"
UTC=true
ARC=false

Open in new window

0
deklinmAuthor Commented:
My /etc/sysconfig/clock looks like

ZONE="America/New_York"
UTC=true
ARC=false

However the time keeps coming up as Thu Dec  8 18:26:37 UTC 2011......7 hours ahead

0
xtermCommented:
That's because its showing the time in UTC (aka GMT)  The time is correct, it's just not showing it with your zone.

You need to do:
cp /usr/share/zoneinfo/America/New_York /etc/localtime

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.