1838005 Members
5499 Online
110124 Solutions
New Discussion

Changing from EST to GMT

 
SOLVED
Go to solution
ATL-Sysadmin
Advisor

Changing from EST to GMT

How do I go about changing my time from EST to GMT? Does it require a reboot?
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor
Solution

Re: Changing from EST to GMT

Hi:

You simply need to change your timezone variable, TZ. No reboot is necessary!

If you want to make this global to the system, modify '/etc/TIMEZONE'. This file is sourced by '/etc/profile'. If you want only selected users to use UTC (GMT) then set and export TZ=UTC in their profile.

Time keeping occurs in UTC. A timezone if only a known offset (positive or negative) from UTC (GMT). It is what you *perceive* to be your local time. In fact, it is what we call "local time". You can see various times in various zones thusly:

# TZ=UTC date
# TZ=EST5EDT date
# TZ=MET-1METDST date

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Changing from EST to GMT

In a very real sense, your server has no notion of a timezone. All time internally is counted in UTC seconds since 00:00:00 1-Jan-1970. The default timezone is stored in /etc/TIMEZONE

all you have to do is edit the file and set
TZ=GMT0

However, currently running processes won't have a clue that anything has changed and will retain their TZ settings. The safest approach would be to schedule a reboot but that is not absolutely necessary.

You also need to give some thought to how your applications store timestamps -- especially "home-grown" applications. For example, if your applications store time as something like YYYY MM DD hh mm ss rather than epoch seconds then making this transition can be difficult.
If it ain't broke, I can fix that.
OldSchool
Honored Contributor

Re: Changing from EST to GMT

the answer depends on the following: Do you mean the system-wide default, or just certain users?

If you mean the system wide default, you need to edit /etc/TIMEZONE and restart any long-running processes like databases and cron. Don't *need* to reboot, but it would insure that you got everything.

If its just for certain users, edit their profiles and set TZ accordingly.

Note that the underlying system time is always UTC, the TZ settings only impact how the time is displayed to user/application
A. Clay Stephenson
Acclaimed Contributor

Re: Changing from EST to GMT

One other change that should be considered is rebuilding the kernel and setting the tinezone tunable there to 0 (number of minutes of offset from UTC) although this shouldn't be required. This is the fallback in the rare case that TZ can't be determined by any other means. You can almost certainly safely ignore this but it is out there.

Bear in mind that you might have users connected from all over the planet -- each with a different (and correct) TZ setting. All you are doing is changing the default for some of the system processes and you should also note that the last TZ setting wins. For example, if TZ is set in /etc/TIMEZONE and then later in a user's .profile it is set to something else (or even set explicitly in a script) then that setting is the one that cvounts for that process -- exactly as it should.
If it ain't broke, I can fix that.
ATL-Sysadmin
Advisor

Re: Changing from EST to GMT

Thanks to all of you for your timely responses.