Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 36256 - Date::Parse doesn't handle RSS dates properly
Summary: Date::Parse doesn't handle RSS dates properly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Perl team
URL: http://slashdot.org/index.rss
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-21 11:37 UTC by Guido Sohne
Modified: 2004-02-27 08:34 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Sohne 2003-12-21 11:37:27 UTC
This has been fixed in a later version, 2.27 but the ebuild in portage is for version 2.22. My own fix, which I made before I discovered about the upstream change is slightly more robust with respect to wierd dates that you may end up seeing when parsing RSS.

Reproducible: Always
Steps to Reproduce:
1. perl -MDate::Parse -e 'print str2time("2003-12-04T05:43:50+01:00:00") . "\n"'
2. perl -MDate::Parse -e 'print str2time("2003-12-04T05:43:50+01:00") . "\n"'
Actual Results:  
Blank line output.

Expected Results:  
1070513030

--- /usr/lib/perl5/vendor_perl/5.8.2/Date/Parse.pm      2003-12-18
00:07:46.000000000 +0000
+++ Date/Parse.pm       2003-12-21 00:58:52.074385504 +0000
@@ -150,7 +150,7 @@
     $zone = tz_offset($1);
     return unless defined $zone;
   }
-  elsif ($dtstr =~ s#\s([a-z]{3,4})?([\-\+]?)-?(\d\d?)(\d\d)?(00)?\s# #o) {
+  elsif ($dtstr =~ s#\s([a-z]{3,4})?([\-\+]?)-?(\d\d?):?(\d\d?)?:?(\d\d?)?\s#
#o) {     my $m = defined($4) ? "$2$4" : 0;
     my $h = "$2$3";
     $zone = defined($1) ? tz_offset($1) : 0;
Comment 1 Eric Sammer (RETIRED) gentoo-dev 2004-01-18 17:41:35 UTC
As strange as this is, I can't find Date::Parse in portage so I can't bump the revision to fix this bug. I'm going to mark this as invalid unless someone can point this out in portage. If this isn't in portage, please use g-cpan.pl to update to the latest version.
Comment 2 Andrey Goder 2004-02-20 18:28:24 UTC
This is actually part of the TimeDate package:

*  dev-perl/TimeDate
      Latest version available: 1.11-r2
      Latest version installed: 1.11-r2
      Size of downloaded files: 16 kB
      Homepage:    http://www.cpan.org/modules/by-module/Date/TimeDate-1.11.readme
      Description: A Date/Time Parsing Perl Module
      License:     Artistic

# qpkg -f /usr/lib/perl5/vendor_perl/5.8.3/Date/Parse.pm
dev-perl/TimeDate *
Comment 3 Michael Cummings (RETIRED) gentoo-dev 2004-02-27 08:34:56 UTC
Updated to 1.16.