From mark.pent at gmail.com Sun Dec 19 21:52:45 2010 From: mark.pent at gmail.com (Mark Pentland) Date: Mon, 20 Dec 2010 12:52:45 +1000 Subject: [TZInfo-users] GMT timezones Message-ID: In not sure if i'm missing something but it appears the GMT +- timezones are inverted. I'm in Brisbane/Australia (GMT + 10), so i'm expecting it to behave similar to Etc/GMT+10 code require 'tzinfo' tz = TZInfo::Timezone.get('Australia/Brisbane') local = tz.utc_to_local(Time.utc(2005,8,29,12,0,0)) => "Mon Aug 29 22:00:00 UTC 2005" #what i would expect.... (10 hrs after GMT) require 'tzinfo' tz = TZInfo::Timezone.get('Etc/GMT+10') local = tz.utc_to_local(Time.utc(2005,8,29,12,0,0)) => "Mon Aug 29 02:00:00 UTC 2005" #this seems the opposite to me... (10 hrs before GMT) Is my assumption incorrect? Thanks Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.pent at gmail.com Sun Dec 19 22:45:30 2010 From: mark.pent at gmail.com (Mark Pentland) Date: Mon, 20 Dec 2010 13:45:30 +1000 Subject: [TZInfo-users] GMT timezones Message-ID: I'm not sure if i'm missing something but it appears the GMT +- timezones are inverted. I'm in Brisbane/Australia (GMT + 10), so i'm expecting it to behave similar to Etc/GMT+10 code require 'tzinfo' tz = TZInfo::Timezone.get('Australia/Brisbane') local = tz.utc_to_local(Time.utc(2005,8,29,12,0,0)) => "Mon Aug 29 22:00:00 UTC 2005" #what i would expect.... (10 hrs after GMT) require 'tzinfo' tz = TZInfo::Timezone.get('Etc/GMT+10') local = tz.utc_to_local(Time.utc(2005,8,29,12,0,0)) => "Mon Aug 29 02:00:00 UTC 2005" #this seems the opposite to me... (10 hrs before GMT) Is my assumption incorrect? Thanks Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From phil.ross at gmail.com Mon Dec 20 09:16:10 2010 From: phil.ross at gmail.com (Philip Ross) Date: Mon, 20 Dec 2010 14:16:10 +0000 Subject: [TZInfo-users] GMT timezones In-Reply-To: References: Message-ID: Hi Mark, On 20 December 2010 02:52, Mark Pentland wrote: > In not sure if i'm missing something but it appears the GMT +- timezones are > inverted. This is the correct behaviour. TZInfo uses data from the tz database (http://www.twinsun.com/tz/tz-link.htm), which defines the Etc/GMT+-x zones in a POSIX-compliant (and confusing) manner. The documentation for the tz database Etc zones states the following: # We use POSIX-style signs in the Zone names and the output abbreviations, # even though this is the opposite of what many people expect. # POSIX has positive signs west of Greenwich, but many people expect # positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses # the abbreviation "GMT+4" and corresponds to 4 hours behind UTC # (i.e. west of Greenwich) even though many people would expect it to # mean 4 hours ahead of UTC (i.e. east of Greenwich). > I'm in Brisbane/Australia (GMT + 10), so i'm expecting it to behave similar > to Etc/GMT+10 > Is my assumption incorrect? Following the POSIX definition, Etc/GMT+10 is a timezone that is fixed at 10 hours behind GMT. For 10 hours ahead of GMT, you'll need Etc/GMT-10. Unless you have a specific need for a timezone that has a fixed GMT offset (and doesn't adjust for daylight savings), you would be better off using the geographical zones (such as Australia/Brisbane). Kind regards, Phil -- Phil Ross http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby From mark.pent at gmail.com Mon Dec 20 18:32:32 2010 From: mark.pent at gmail.com (Mark Pentland) Date: Tue, 21 Dec 2010 09:32:32 +1000 Subject: [TZInfo-users] GMT timezones In-Reply-To: References: Message-ID: Hi Phil, Thanks for the quick reply. I also suggest using the geographical zones to my users... it was a user of my system that raised this as a bug.... What confused me further was the site: http://wwp.greenwichmeantime.com/time-zone/australia/queensland/ It states that Queensland is in GMT+10 .. http://www.worldtimezone.com/ also shows Brisbane in GMT+10 I'm guessing these sites are not using the POSIX standard... I think the best solution is to remove the Etc/* timezones from the list on my site. Thanks for your help Mark On Tue, Dec 21, 2010 at 12:16 AM, Philip Ross wrote: > Hi Mark, > > On 20 December 2010 02:52, Mark Pentland wrote: > > In not sure if i'm missing something but it appears the GMT +- timezones > are > > inverted. > > This is the correct behaviour. TZInfo uses data from the tz database > (http://www.twinsun.com/tz/tz-link.htm), which defines the Etc/GMT+-x > zones in a POSIX-compliant (and confusing) manner. The documentation > for the tz database Etc zones states the following: > > # We use POSIX-style signs in the Zone names and the output abbreviations, > # even though this is the opposite of what many people expect. > # POSIX has positive signs west of Greenwich, but many people expect > # positive signs east of Greenwich. For example, TZ='Etc/GMT+4' uses > # the abbreviation "GMT+4" and corresponds to 4 hours behind UTC > # (i.e. west of Greenwich) even though many people would expect it to > # mean 4 hours ahead of UTC (i.e. east of Greenwich). > > > I'm in Brisbane/Australia (GMT + 10), so i'm expecting it to behave > similar > > to Etc/GMT+10 > > > Is my assumption incorrect? > > Following the POSIX definition, Etc/GMT+10 is a timezone that is fixed > at 10 hours behind GMT. For 10 hours ahead of GMT, you'll need > Etc/GMT-10. > > Unless you have a specific need for a timezone that has a fixed GMT > offset (and doesn't adjust for daylight savings), you would be better > off using the geographical zones (such as Australia/Brisbane). > > Kind regards, > > Phil > > -- > Phil Ross > http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby > _______________________________________________ > TZInfo-users mailing list > TZInfo-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/tzinfo-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phil.ross at gmail.com Tue Dec 21 08:58:17 2010 From: phil.ross at gmail.com (Philip Ross) Date: Tue, 21 Dec 2010 13:58:17 +0000 Subject: [TZInfo-users] GMT timezones In-Reply-To: References: Message-ID: Hi Mark, On 20 December 2010 23:32, Mark Pentland wrote: > What confused me further was the > site:?http://wwp.greenwichmeantime.com/time-zone/australia/queensland/ > It states that Queensland is in GMT+10 .. > http://www.worldtimezone.com/?also shows Brisbane in GMT+10 > I'm guessing these sites are not using the POSIX standard... Yes, both of those sites use the standard convention of GMT+n for n hours ahead of GMT and GMT-n for n hours behind GMT (the opposite to POSIX). > I think the best solution is to remove the Etc/* timezones from the list on > my site. That sounds like it would be the best option. Kind regards, Phil -- Phil Ross http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby