Re: Problems with DateTime::TimeZone->short_name_for_datetime()
Oh. Duh. I took the line "This class has the following methods" to mean that it was a class method not an object method. Dunno why I read it like that, everything is pretty clearly intended to be called through an object. Anyway, DateTime's time_zone_short_name method was actually what I should have been using since I don't have a TZ object the TZ should be able to tell me it's short name... Thanks, -ben On Wed, Jun 25, 2003 at 01:50:39PM -0500, Dave Rolsky wrote: > On Wed, 25 Jun 2003, Ben Bennett wrote: > > > my $short = DateTime::TimeZone->short_name_for_datetime($dt); > > This is an object method, not a class method. > > > On a related note, while trying to chase this problem I noticed that > > DT::TZ->span_for_datetime() compares $type to "UTC" to determine $end, > > but all of the callers are passing in "utc". > > That's a bug. Now I just need to figure out how to test it. > > > -dave > > /*=== > House Absolute Consulting > www.houseabsolute.com > ===*/
Re: Problems with DateTime::TimeZone->short_name_for_datetime()
On Wed, 25 Jun 2003, Ben Bennett wrote: > my $short = DateTime::TimeZone->short_name_for_datetime($dt); This is an object method, not a class method. > On a related note, while trying to chase this problem I noticed that > DT::TZ->span_for_datetime() compares $type to "UTC" to determine $end, > but all of the callers are passing in "utc". That's a bug. Now I just need to figure out how to test it. -dave /*=== House Absolute Consulting www.houseabsolute.com ===*/
Problems with DateTime::TimeZone->short_name_for_datetime()
Code that exhibits the problem: -- #!/usr/local/bin/perl -w use strict; use DateTime; use DateTime::TimeZone; my $dt= DateTime->new(year => 2003, month => 6, time_zone => "America/New_York"); my $short = DateTime::TimeZone->short_name_for_datetime($dt); print "$short\n"; -- The error: -- Can't use string ("DateTime::TimeZone") as a HASH ref while "strict refs" in use at /usr/lib/perl5/site_perl/5.8.0/DateTime/TimeZone.pm line 287. -- On a related note, while trying to chase this problem I noticed that DT::TZ->span_for_datetime() compares $type to "UTC" to determine $end, but all of the callers are passing in "utc". -ben