From: Eric Wong Date: Sun, 5 Jul 2020 23:27:33 +0000 (+0000) Subject: wwwatomstream: simplify feed_update callers X-Git-Tag: v1.6.0~283 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=c447bbbd wwwatomstream: simplify feed_update callers We always return Z (UTC) times, anyways, so we'll always use gmtime() on the seconds-after-the-epoch. --- diff --git a/Documentation/mknews.perl b/Documentation/mknews.perl index 965c30c1..ba049d9e 100755 --- a/Documentation/mknews.perl +++ b/Documentation/mknews.perl @@ -131,7 +131,7 @@ sub atom_start { delete $astream->{emit_header}; my $ibx = $ctx->{-inbox}; my $title = PublicInbox::WwwAtomStream::title_tag($ibx->description); - my $updated = PublicInbox::WwwAtomStream::feed_updated(gmtime($mtime)); + my $updated = PublicInbox::WwwAtomStream::feed_updated($mtime); print $out < ) . qq() . qq($page_id) . - feed_updated(gmtime($mtime)); + feed_updated($mtime); } # returns undef or string @@ -125,9 +125,7 @@ sub feed_entry { $irt = ''; } my $href = $base . mid_href($mid) . '/'; - my $t = msg_timestamp($hdr); - my @t = gmtime(defined $t ? $t : time); - my $updated = feed_updated(@t); + my $updated = feed_updated(msg_timestamp($hdr)); my $title = $hdr->header('Subject'); $title = '(no subject)' unless defined $title && $title ne ''; @@ -158,7 +156,7 @@ sub feed_entry { } sub feed_updated { - '' . strftime('%Y-%m-%dT%H:%M:%SZ', @_) . ''; + '' . strftime('%Y-%m-%dT%H:%M:%SZ', gmtime(@_)) . ''; } 1;