Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 419477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:46:53+00:00 2026-05-12T18:46:53+00:00

Ever since British Summer Time ended in the UK last week my application has

  • 0

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 third party library which we use is using DateTime::Format::W3CDTF to format paramters during a SOAP call. Because the formatting is failing the calls are failing.

Anyone have any clues? I’m no Perl guru so any help would be really appreciated. Could this be a bug in the DateTime::Format::W3CDTF library?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T18:46:53+00:00Added an answer on May 12, 2026 at 6:46 pm

    Looking at the implementation of W3CDTF I think this might actually be a bug in the library:

    sub format_datetime
    {
        my ( $self, $dt ) = @_;
    
        my $base = sprintf( '%04d-%02d-%02dT%02d:%02d:%02d',
            $dt->year, $dt->month, $dt->day,
            $dt->hour, $dt->minute, $dt->second );
    
    
        my $tz = $dt->time_zone;
    
        return $base if $tz->is_floating;
    
        return $base . 'Z' if $tz->is_utc;
    
        if (my $offset = $dt->offset()) {
            return $base . offset_as_string($offset );
        }
    }
    

    Note that if $tz->is_utc is false, but $dt->offset() is 0 then there is neither return codepath is being hit, which I guess in Perl means that a nil is implicitly returned. I think that scenario is what my sample script is hitting – ‘Europe/London’ is not technically UTC, but it does still have an offset of 0.

    UPDATE

    After a bit more research I found that this same bug has already been reported (2 years ago!). The bug report includes a patch which appears to resolve the issue (although I haven’t tested that personally).

    UPDATE 2

    A fix for this has been released

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ever since Microsoft has introduced the application blocks, I've been bumping into people who
Ever since I started programming this has been something I have been curious about.
This has been bugging me ever since I started learning Ruby five months ago:
Ever since .net 2.0 release this question has been discussed over a large number
I been working on porting my application on Rails 3.0.7 ,ever since I started
Ever since I started programming this question has been annoying me, not where is
Ever since the release of Timeline, getting videos to embed on Facebook has been
Ever since I created this Rails 3.2.3 project to use MiniTest, I have been
Ever since I discovered sockets, I've been using the nonblocking variants, since I didn't
Ever since I moved from VB6 to VB.NET somewhere in 2005, I've been using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.