On Mon, 2 Nov 2009, Ronald J Kimball wrote:

When I get the wrong result, the first DateTime object has its time zone set to UTC, rather than to America/New York (my local time zone).

The object is created like so:

 my %tmp;
 @tmp{qw/ year month day hour minute second /} =
   $current_delivery_date =~ /(\d+)/g;
 my $dt = DateTime->new(%tmp, time_zone => 'local');

Then, I check the name of the time zone with:

 $dt->time_zone->name

and sometimes it's UTC.

Do you have any guesses as to why this could be happening?

Sometimes DateTime::TimeZone thinks your local time zone is UTC. I have no idea why it'd would be doing this. You could hack up a local copy of DateTime::TimeZone::Local::Unix and have it spit out everything it's doing and what it finds.

Either it's doing something wrong or your system is very oddly configured.


-dave

/*============================================================
http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)
============================================================*/

Reply via email to