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

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?
0
AdrianSmithUK
Asked:
AdrianSmithUK
  • 6
  • 3
3 Solutions
 
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
AdrianSmithUKAuthor Commented:
PS: I had to reboot the server for PHP to pick up the new time settings.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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