Skip Menu |

This queue is for tickets about the DateTime-Format-W3CDTF CPAN distribution.

Report information
The Basics
Id: 3766
Status: resolved
Priority: 0/
Queue: DateTime-Format-W3CDTF

People
Owner: Nobody in particular
Requestors: aaron [...] aaronland.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: format_datetime returns undef when time_zone is set
DateTime::Format::W3CDTF->format_datetime (0.3) returns undef when you pass it a DateTime object whose timezone has been explicitly set. I fixed this by passing the return value of the DateTime object's 'offset' value to the internal 'offset_to_string' function, rather than passing the TimeZone's 'offset' set key. A patch is attached.
--- ./W3CDTF.pm.dist Mon Mar 10 12:50:05 2003 +++ ./W3CDTF.pm Wed Sep 10 23:26:20 2003 @@ -95,8 +95,8 @@ if ( $dt->hour || $dt->min || $dt->sec ) { return $base . 'Z' if $tz->is_utc; - if ( $tz->{'offset'} ) { - return $base . offset_as_string( $tz->{'offset'} ); + if (my $offset = $dt->offset()) { + return $base . offset_as_string($offset ); } } else {
Applied. Fixed in 0.04 [guest - Wed Sep 10 23:38:02 2003]: Show quoted text
> DateTime::Format::W3CDTF->format_datetime (0.3) returns undef when you > pass it a DateTime object whose timezone has been explicitly set. > > I fixed this by passing the return value of the DateTime object's > 'offset' value to the internal 'offset_to_string' function, rather > than passing the TimeZone's 'offset' set key. > > A patch is attached.