1820694 Members
2623 Online
109627 Solutions
New Discussion юеВ

Setting GMT time

 
SOLVED
Go to solution
YLTan
Frequent Advisor

Setting GMT time

Hi

I have a system in local time (i think ) and I need to set this server to GMT time so the developer can do some test on their program.

How do I change the time to GMT and back?

regards
tyl
7 REPLIES 7
Hartmut Lang
Trusted Contributor
Solution

Re: Setting GMT time

See /etc/TIMEZONE for TZ value set on your machine.
Any user can overwrite the TZ value in his environment (e.g. for sh): TZ=GMT0BST

See /usr/lib/tztab for all possible TZ values.

I think there is no need to change/set the real-time clock of your machine.

Hartmut
Michael Tully
Honored Contributor

Re: Setting GMT time

Hi,

You need to use the 'date' program.

date [-u] [mmddhhmm[[cc]yy]]
e.g.
To set the date as 2nd may 2002 for 1:05AM
# date -u 050201052002

The -u options indicates the UTC or GMT.
Have a look at the man page for a full description.

Cheers
~Michael~
Anyone for a Mutiny ?
T G Manikandan
Honored Contributor

Re: Setting GMT time

Hello
change the TZ variable.
TZ=
eg
TZ=GMT-5.30
Thanks
G Manikandan
Steven Sim Kok Leong
Honored Contributor

Re: Setting GMT time

Hi,

If you wish to set it for the whole system, then following is the neatest way:

# set_parms timezone

Hope this helps. Regards.

Steven Sim Kok Leong
Niraj Kumar Verma
Trusted Contributor

Re: Setting GMT time

Hi,

you can achive this in two ways

1. As steven says set_params
(Recommended)
2.
# vi /etc/TIMEZONE
Change the TZ variable
TZ=GMT

Niraj
Niraj.Verma@philips.com
Sukant Naik
Trusted Contributor

Re: Setting GMT time

Hi

This is possible in two ways.

1. The best way is by using the command
# set_parms timezone

2. By changing the value of the TZ variable in the /etc/TIMEZONE file

So choice is yours.

-Sukant
Who dares he wins
Wodisch
Honored Contributor

Re: Setting GMT time

Hi,

actually you need three steps:
- modify your system's TZ by editing "/etc/TIMEZONE", like most already told you
- setting your system's clock to UTC, like Michael told you
- reboot your system to make ALL your daemons aware of the new timezone...

HTH,
Wodisch