LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change time zone (https://www.linuxquestions.org/questions/linux-newbie-8/change-time-zone-733534/)

ust 06-17-2009 02:05 AM

change time zone
 
I have Redhat server , I want to change it to GMT time zone , I tried to use tzselect to select "london" , then found the time zone is BST now , can advise what I need to do so that the time zone is GMT ? thx

jdkaye 06-17-2009 02:32 AM

Quote:

Originally Posted by ust (Post 3576722)
I have Redhat server , I want to change it to GMT time zone , I tried to use tzselect to select "london" , then found the time zone is BST now , can advise what I need to do so that the time zone is GMT ? thx

If I understand you correctly you want your time to always be GMT. I would select London, as you've done and disable the automatic summertime adjustment feature.
cheers,
jdk

ust 06-17-2009 02:50 AM

Quote:

Originally Posted by jdkaye (Post 3576748)
If I understand you correctly you want your time to always be GMT. I would select London, as you've done and disable the automatic summertime adjustment feature.
cheers,
jdk

Yes , I just want to change to GMT but now is BST , I need to do is disable "summertime adjustment feature" ? can advise what I can do it ? thx

jdkaye 06-17-2009 02:53 AM

Quote:

Originally Posted by ust (Post 3576777)
Yes , I just want to change to GMT but now is BST , I need to do is disable "summertime adjustment feature" ? can advise what I can do it ? thx

I don't know that off the top of my head. I can look it up myself but then so can you. Are you too busy to do that yourself?
cheers,
jdk

ust 06-17-2009 03:28 AM

Quote:

Originally Posted by jdkaye (Post 3576781)
I don't know that off the top of my head. I can look it up myself but then so can you. Are you too busy to do that yourself?
cheers,
jdk


thx reply ,

I use tzselect and tried setup command of Redhat , but can't find GMT ...

so I just ask it . thx.

jdkaye 06-17-2009 03:48 AM

Quote:

Originally Posted by ust (Post 3576826)
thx reply ,

I use tzselect and tried setup command of Redhat , but can't find GMT ...

so I just ask it . thx.

What about trying?
Code:

dpkg-reconfigure tzdata
jdk

jdkaye 06-17-2009 03:54 AM

Quote:

Originally Posted by ust (Post 3576826)
thx reply ,

I use tzselect and tried setup command of Redhat , but can't find GMT ...

so I just ask it . thx.

I also found this after 20 seconds of googling:


Quote:

-> Editing the file /etc/default/rcS with

Code:

gksudo gedit /etc/default/rcS
and changing the UTS parameter to either: UTC=yes or UTC=no seems to enable/disable DST functionality.

(P.S. The biggest asset of a Linux user is patience.)
cheers,
jdk

ust 06-17-2009 04:13 AM

Quote:

Originally Posted by jdkaye (Post 3576845)
I also found this after 20 seconds of googling:



cheers,
jdk

thx replies ,

the comamnd dpkg-reconfigure tzdata is not available in my linux server ,

the file /etc/default/rcS is also not persent in my linux server


thx

jdkaye 06-17-2009 04:21 AM

If we're talking about debian then
Code:

sudo aptitude install initscripts
otherwise there's loads more solutions. Just google for them.
jdk

EricTRA 06-17-2009 04:25 AM

Hi,

Don't know what version of RH you are using but on my Enterprise version 5.3 typing the command:

system-config-date

gives me a 'graphical' menu from which I can set all options.

Also:

In order to change the timezone of your system you will need to access the file /etc/sysconfig/clock directly:


#ZONE="America/New_York"
ZONE="GMT"
UTC=false
ARC=false

Note: If your system's BIOS has UTC set to true, then set UTC to true. If it has it set to false, set it to false. UTC in the configuration file must always reflect your BIOS settings.

Kind regards,

Eric

ust 06-17-2009 04:41 AM

Quote:

Originally Posted by EricTRA (Post 3576874)
Hi,

Don't know what version of RH you are using but on my Enterprise version 5.3 typing the command:

system-config-date

gives me a 'graphical' menu from which I can set all options.

Also:

In order to change the timezone of your system you will need to access the file /etc/sysconfig/clock directly:


#ZONE="America/New_York"
ZONE="GMT"
UTC=false
ARC=false

Note: If your system's BIOS has UTC set to true, then set UTC to true. If it has it set to false, set it to false. UTC in the configuration file must always reflect your BIOS settings.

Kind regards,

Eric

fix reply ,
for your second method , I should use UTC ( ture or false ) or not ? my RH server now is true .

I don't know what is my bios setting ? except reboot the server , how can I know the UTC setting of my bios ?

EricTRA 06-17-2009 05:01 AM

Hello,

Standard Linux uses UTC time, if you don't want to use the Universal Time then you put UTC=false.

First, to enter the BIOS you'll have to reboot and press a certain key or key-combo to enter the BIOS (it shows on the console when booting). Then in the BIOS you can verify.

But if I'm not mistaking the command

hwclock

reads the information from the BIOS. Check if it gives you a different output then the regular date command does.

This page: http://www.redhat.com/advice/tips/timezone.html might give you some more detailed info if needed.

Kind regards,

Eric

smithy2010 05-07-2010 07:13 PM

I had similar problem and I did this:

To set up system time and then to synchronize it with hardware time and to move from BST to GMT do the following:

EXAMPLE:

log in as root:

#date -s "Fri May 7 23:26:00 GMT 2010"

#hwclock --set --date="Fri May 7 23:26:00 GMT 2010"

next you need to set symbolic link, to do that run:

# ln -sf /usr/share/zoneinfo/Europe/Greenwich /etc/localtime


to display current hardware clock run:

# hwclock



to display current data and time run:

# date -u

Sat May 7 23:43:32 UTC 2010

to sync system and hardware clock run:

# hwclock –systohc



# hwclock


Sat 07 May 2010 23:43:00 AM UTC -0.554798 seconds


I hope it works for you as well

Cheers


Denis

ajeetsinghraina 05-07-2010 09:45 PM

1. Logged in as root, check which timezone your machine is currently using by executing `date`
. You'll see something like Mon 17 Jan 2005 12:15:08 PM PST, PST in this case is the current timezone.
2.Change to the directory /usr/share/zoneinfo here you will find a list of time zone regions. Choose the most appropriate region, if you live in Canada or the US this directory is the "America" directory.
3.If you wish, backup the previous timezone configuration by copying it to a different location. Such as

mv /etc/localtime /etc/localtime-old
4.Create a symbolic link to the appropriate timezone from /etc/localtime. Example:

ln -sf /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime

5.If you have the utility rdate, update the current system time by executing

/usr/bin/rdate -s time-a.nist.gov

6.Set the ZONE entry in the file /etc/sysconfig/clock file (e.g. "America/Los_Angeles")
7.Set the hardware clock by executing:

/sbin/hwclock --systohc


All times are GMT -5. The time now is 09:02 AM.