Hi Folks,

Ever since British Summer Time ended in the UK last week my application has been seeing a very interesting bug. Here's an isolated perl script which demonstrates the issue:


   #!/usr/bin/perl
use strict; use warnings; use DateTime::Format::W3CDTF;
   use DateTime::Format::ISO8601;
my $tz = 'Europe/London'; sub print_formatted_date {
     my $date = shift;
my $tz_date = DateTime::Format::ISO8601->new->parse_datetime( $date );
     $tz_date->set_time_zone( $tz );
print "tz_date: $tz_date\n";
     $tz_date->set_formatter( DateTime::Format::W3CDTF->new );
print "tz_date with W3C formatter: $tz_date\n";
   }
print_formatted_date( '2009-10-25' );
   print "\n";
   print_formatted_date( '2009-10-26' );



The output of this is:


   tz_date:  2009-10-25T00:00:00
   tz_date with W3C formatter: 2009-10-25T00:00:00+01:00
tz_date: 2009-10-26T00:00:00
   tz_date with W3C formatter: 0



Notice that for dates which fall outside of BST the W3C formatter is rendering them as '0'.

This is an issue for me because a 3rd party library which my app uses is using DateTime::Format::W3CDTF to format parameters during a SOAP call. Because the formatting is failing the calls are failing.

Could this be a bug in the DateTime::Format::W3CDTF library? I'm no perl guru so any help would be really appreciated. Please do ask away if there is any other pertinent information I can provide which would shed light on this.

Cheers,
Pete

Reply via email to