On Wed, Dec 4, 2013, at 11:08 PM, Zefram wrote:
> Alfie John wrote:
> > If it doesn't aim to have mappings to all of
> >the Olson entries is there a reason not to provide mappings with my
> >patches?
>
> Dave Rolsky can answer better about the design intent. But there's
> a practical issue with changing right now: we're in the process of
> transitioning to a reimplementation of DT:TZ. Current state is that the
> new DT:TZ is ready, but DateTime has reacquired an over-sensitive test
> (of a type we fixed one instance of some time ago) that looks at timezone
> error messages and fails against the new DT:TZ.
No problem. I'll switch to DT::TZ::Olson for now until the new DT::TZ is
out. Thanks for the heads up.
> >looks like there's a bug (POSIX sign flipping which I've fixed in my
> >patch to DateTime::TimeZone):
>
> I believe you're mistaken about the bug. (It seems to be a firm rule
> that everyone working with timezones gets the sign wrong occasionally.)
> Looking at your test case:
> > print "$dt\n";
> > $dt->set_time_zone(olson_tz("Etc/GMT+10"));
> > print $dt,"\n";
>
> You've started with a DateTime in UT, and asked for it to be reexpressed
> in the Etc/GMT+10 zone, which (due to the strange sign convention) is a
> fixed ten hours *behind* UT. So I would expect the second time emitted
> to be ten hours earlier than the first one, as seen in your
>
> >Actual output:
> >
> > 2013-12-03T23:39:11
> > 2013-12-03T13:39:11
Are you able to help fill the gaps in my understanding. This just
confused me a bit...
The current UTC is:
$ perl -we 'use DateTime; print DateTime->now(),"\n"'
2013-12-04T22:01:08
I'm in Melbourne (Australia), which is 11 hour ahead of UTC (i.e.
UTC+11):
$ perl -we 'use DateTime; use DateTime::TimeZone::Olson qw{olson_tz};
print DateTime->now(time_zone =>
olson_tz("Australia/Melbourne")),"\n"'
2013-12-05T09:01:08
But here is what I get for Etc/GMT+11:
$ perl -we 'use DateTime; use DateTime::TimeZone::Olson qw{olson_tz};
print DateTime->now(time_zone => olson_tz("Etc/GMT+11")),"\n"'
2013-12-04T11:01:08
And again for Etc/GMT-11:
$ perl -we 'use DateTime; use DateTime::TimeZone::Olson qw{olson_tz};
print DateTime->now(time_zone => olson_tz("Etc/GMT-11")),"\n"'
2013-12-05T09:01:08
I guess it's a tautology seeing as that's what's defined in the etcetera
file, but was I wrong in assuming that UTC+11 meant Etc/GMT+11?
Alfie
--
Alfie John
[email protected]