So there was a reported bug[1] with offset_as_seconds() in TimeZone.pm,
which resulted in:

--
revision 1.27
date: 2003/02/11 05:33:54;  author: autarch;  state: Exp;  lines: +3 -9
don't be so smart when converting offsets between string & number forms
--

-     # if it's just a number assume it's seconds
-     return $offset if $offset =~ /^-?\d+$/;

Unfortunately TimeZone::OffsetOnly relied on that behaviour.

So now if you pass in a timezone of +01:00, TimeZone::OffsetOnly, gets
passed an offset of 3600 seconds, which is passed back to
offset_as_seconds, which interprets this as 36 hours, and sets the offset
to 129600

I can see a couple of solutions, but I'm not sure which the best one is.

a. revert the changes from 1.27
b. pass the $p{name} to OffsetOnly->new() instead of $offset (and force
$offest to be calculated twice)
c. give OffsetOnly a special constructor that expects a pre-calculated
offset (e.g. OffsetOnly->from_seconds( $offset ) )

I would be happy to implement any of these, but as I'm just starting to
work with DateTime don't really have a reccomendation.

kellan

1. http:[EMAIL PROTECTED]/msg00927.html

-- 
"the truth is always revolutionary" [antonio gramsci]

[EMAIL PROTECTED]

Reply via email to