about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwAtomStream.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-07-13 22:47:29 +0000
committerEric Wong <e@80x24.org>2017-07-13 22:47:29 +0000
commit2a5b77c0cdd9bb1f726fd05b01d3095b029367ac (patch)
treea61b5800d0dcc395578fbf565a7c044e1e0a12da /lib/PublicInbox/WwwAtomStream.pm
parent644c094896c54b9594e2dac65d761e925bde78d0 (diff)
downloadpublic-inbox-2a5b77c0cdd9bb1f726fd05b01d3095b029367ac.tar.gz
Oops, we must not discard the timezone when parsing dates
for the Atom stream.
Diffstat (limited to 'lib/PublicInbox/WwwAtomStream.pm')
-rw-r--r--lib/PublicInbox/WwwAtomStream.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm
index 5a10034b..b9c7468f 100644
--- a/lib/PublicInbox/WwwAtomStream.pm
+++ b/lib/PublicInbox/WwwAtomStream.pm
@@ -7,7 +7,7 @@ use strict;
 use warnings;
 
 use POSIX qw(strftime);
-use Date::Parse qw(strptime);
+use Date::Parse qw(str2time);
 use Digest::SHA qw(sha1_hex);
 use PublicInbox::Address;
 use PublicInbox::Hval qw(ascii_html);
@@ -109,8 +109,8 @@ sub feed_entry {
         }
         my $href = $base . mid_escape($mid) . '/';
         my $date = $hdr->header('Date');
-        my @t = eval { strptime($date) } if defined $date;
-        @t = gmtime(time) unless scalar @t;
+        my $t = eval { str2time($date) } if defined $date;
+        my @t = gmtime(defined $t ? $t : time);
         my $updated = feed_updated(@t);
 
         my $title = $hdr->header('Subject');