Centos 5.4: How to set time and date.

I need to set the time, date and timezone to UK with daylight saving on.

How do I do it?
AdrianSmithUKAsked:
Who is Participating?
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.

medveddCommented:
cd /etc
ln -sf /usr/share/zoneinfo/Europe/London localtime
0
AdrianSmithUKAuthor Commented:
Hi Medvedd

Didn't work unfortunatly. Here is what I got.



[root@s15345671 ~]# cd /etc
[root etc]# ln -sf /usr/share/zoneinfo/Europe/London localtime
[root]# date
Fri Mar 26 00:40:45 EDT 2010

Open in new window

0
medveddCommented:
OK, try to use command

system-config-date

0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

AdrianSmithUKAuthor Commented:
Here's the result.

[root@s15345671 /]# system-config-date
-bash: system-config-date: command not found
0
medveddCommented:
Hmm. It should be in

/usr/bin/system-config-date
0
AdrianSmithUKAuthor Commented:
Afraid not. I only have a minimal installation. ie First disk.

[root@s15345671 /]# /usr/bin/system-config-date
-bash: /usr/bin/system-config-date: No such file or directory
0
berniepCommented:
linking to the /etc/localtime file sets the timezone of the system, but doesn't set it's date nor time.

you can do that manually using the date command, syntax:

date MMDDHHMM

eg: date 03272017 (sets it to March 27th, 8:17pm - time here in sydney)

Further, you can automate syncing the time with a network time protocol NTP server using the ntpdate command.  HTH.
0
AdrianSmithUKAuthor Commented:
Hi Berniep

Thanks for the info. Unfortunatly I need to change the time zone as well. At the moment I'm stuck with EDT.

If I changed the timezone the time would be correct.

Do you know how to do that?

Kind Regards,

Adrian
0
AdrianSmithUKAuthor Commented:
Fixed it.

The final solution was close to medvedd's.

ln -sf /usr/share/zoneinfo/GMT /etc/localtime

I took this from:

http://lists.centos.org/pipermail/centos/2006-June/023719.html 

But I added the "f" parameter to force the link as centos kept telling me that it already existed.
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
AdrianSmithUKAuthor Commented:
PS: I had to reboot the server for PHP to pick up the new time settings.
0
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.