1825801 Members
2260 Online
109687 Solutions
New Discussion

GMT-N TIMEZONE

 
SOLVED
Go to solution
Ivan Ferreira
Honored Contributor

GMT-N TIMEZONE

I though that GMT-4 or UTC-4 substracts the time from UTC. Now, see the following output:

zdump UTC
UTC Thu Oct 27 06:26:09 2005 UTC

zdump UTC-1
UTC-1 Thu Oct 27 07:26:22 2005 UTC

zdump UTC-2
UTC-2 Thu Oct 27 08:26:23 2005 UTC

zdump UTC-3
UTC-3 Thu Oct 27 09:26:24 2005 UTC

zdump UTC-4
UTC-4 Thu Oct 27 10:26:25 2005 UTC

These zone info files seems to add the specified number of hours instead of substracting. How come?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
5 REPLIES 5
Han Pilmeyer
Esteemed Contributor

Re: GMT-N TIMEZONE

Ivan,

Not exactly sure what you'r easking, but try this:

TZ=:US/Eastern date
TZ=:Para date
zdump :Para

Perhaps this will lead you to the answer you're looking for.
Ivan Ferreira
Honored Contributor

Re: GMT-N TIMEZONE

That was not really the question, but thanks.

What I want to know is why the zone file for GMT-N, instead of substracting the time from UTC, it adds the time?

Is supposted that GMT-4 should substract 4 hours from UTC, but in the ouput of the commands shows that it adds hours to UTC.

Also GMT+N substracts N hours to UTC, that is what i don't understand. It's seems that the zone info files are inverted.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Han Pilmeyer
Esteemed Contributor
Solution

Re: GMT-N TIMEZONE

You should think of it as "hours ahead" of GMT when the minus is used. Or as "before" GMT. So with GMT-4 you are not subtracting 4 hours from the time, but you are looking at the timezone where they are fours hours ahead (East) of GMT. There it is 4 hours _later_.

Actually... I think it used to be the other way round and then we changed it if I'm not mistaken. Probably some POSIX standard or so.
Martin Moore
HPE Pro

Re: GMT-N TIMEZONE

Han is correct, as usual. We used to have the timezones implemented such that "GMT-4" meant 4 hours behind GMT (which seems more intuitive to me, personally). However, POSIX specifies the timezones the other way around (GMT-4 being 4 hours ahead of GMT), so we changed it in V5 to be compliant with the standard. See the comments in file /etc/zoneinfo/sources/etcetera for more information.

Martin
I work for HPE
A quick resolution to technical issues for your HPE products is just a click away HPE Support Center
See Self Help Post for more details

Accept or Kudo

Ivan Ferreira
Honored Contributor

Re: GMT-N TIMEZONE

Thanks to all. I was just confused by the name of the zone.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?