Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

set timezone to GMT+?

Status
Not open for further replies.

oceandeep

IS-IT--Management
Jul 6, 2000
69
GR
Hi,

On RH AS3, how can I set time zone to something like GMT+8? right now the date command shows time zone as SGT, but we would like it to show GMT+8.

Thanks!

- JIANG -
 
My guess is that you would need to use zic (see the man page) to create a new timezone file in /usr/share/zoneinfo. Ideally if you could find the source for the Singapore time zone then you could just modify it to display the GMT+8 format that you want, however it would be non-standard I believe.

Annihilannic.
 
A very interesting thing for RH AS3 time zone setting, I am not sure if it is a bug or "feature" of RH. I set it to GMT+8, but when synchronize with NTP server, the time offsets to GMT-8. And when I set it to GMT-8, then it means Singapore time. It seems RH reverts the "+" and "-"...

- Jiang -
 
No, neither bug, nor feature, it's just the way it works. I can't find this information in the Red Hat man pages unfortunately, however on Solaris man -s5 environ has a good description of the POSIX TZ format, which includes:

[tt] TZ Timezone information. The contents of this environment
variable are used by the functions ctime(3C),
localtime(3C), strftime(3C), and mktime(3C) to over-
ride the default timezone. If TZ is not in the follow-
ing form, it designates a path to a timezone database
file relative to /usr/share/lib/zoneinfo/, ignoring
the first character if it is a colon :)); otherwise,
TZ has the form:


stdoffset[dst[offset],[start[/time],end[/time]]]


std and dst
Three or more bytes that are the designation for
the standard (std) and daylight savings time
(dst) timezones. Only std is required. If dst
is missing, then daylight savings time does not
apply in this locale. Upper- and lower-case
letters are allowed. Any characters except a
leading colon :)), digits, a comma (,), a minus
(-) or a plus (+) are allowed.

offset
Indicates the value one must add to the local
time to arrive at Coordinated Universal Time.
The offset has the form:


hh[:mm[:ss]][/tt]

Notice that in TZ the offset is what you need to add to the local time to arrive at Coordinated Universal Time, so it is the reverse of what you are expecting.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top