Skip Menu |
 

This queue is for tickets about the TimeDate CPAN distribution.

Report information
The Basics
Id: 1312
Status: resolved
Priority: 0/
Queue: TimeDate

People
Owner: Nobody in particular
Requestors: jlpoutre [...] corp.home.nl
Cc:
AdminCc:

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

Attachments


Subject: Enhancement for Date::Parse
Download (untitled) / with headers
text/plain 454b
Graham, Date::Parse 2.23 appears not to understand the ISO format for UTC time, where a capital 'Z' is appended to the time, instead of +00 or something. The accompanying patch is meant to fix this. I verified nothing breaks for the test suite in "t/date.t" and appended the following tests: 20020722T100000Z Jul 22 10:00:00 UTC 2002 10:00:00Z 10:00:00 10:00 10:00 +100 10:00 +0100 These all pass; not sure if we need more tests... Cheers, Joe.
Download DateParse.patch
text/x-diff 1.2k
*** Parse.pm.BAK Thu Jun 6 20:12:58 2002 --- Parse.pm Mon Jul 22 15:45:05 2002 *************** sub { *** 88,101 **** $dtstr =~ s#($daypat)\s*(den\s)?# #o; # Time: 12:00 or 12:00:00 with optional am/pm ! if ($dtstr =~ s/(?:^|\s)(\d{4})([-:]?)(\d\d?)\2(\d\d?)(?:[Tt ](\d\d?)(?:([-:]?)(\d\d?)(?:\6(\d\d?)(?:[.,]\d+)?)?)?)?\b/ /) { ($year,$month,$day,$hh,$mm,$ss) = ($1,$3-1,$4,$5,$7,$8); } else { ! if ($dtstr =~ s#[:\s](\d\d?):(\d\d?)(:(\d\d?)(?:\.\d+)?)?\s*(?:([ap])\.?m?\.?)?\s# #o) { ($hh,$mm,$ss) = ($1,$2,$4 || 0); $merid = $ampm{$5} if $5; } # Time: 12 am --- 88,103 ---- $dtstr =~ s#($daypat)\s*(den\s)?# #o; # Time: 12:00 or 12:00:00 with optional am/pm ! if ($dtstr =~ s/(?:^|\s)(\d{4})([-:]?)(\d\d?)\2(\d\d?)(?:[Tt ](\d\d?)(?:([-:]?)(\d\d?)(?:\6(\d\d?)(?:[.,]\d+)?)?)?)?([Zz])?\b/ /) { ($year,$month,$day,$hh,$mm,$ss) = ($1,$3-1,$4,$5,$7,$8); + $dtstr .= "+00 " if $9; } else { ! if ($dtstr =~ s#[:\s](\d\d?):(\d\d?)(:(\d\d?)(?:\.\d+)?)?\s*(?:([ap])\.?m?\.?)?([Zz])?\s# #o) { ($hh,$mm,$ss) = ($1,$2,$4 || 0); $merid = $ampm{$5} if $5; + $dtstr .= "+00 " if $6; } # Time: 12 am


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.