From: Eric Wong (Contractor, The Linux Foundation) Date: Thu, 15 Feb 2018 23:20:20 +0000 (+0000) Subject: import: allow the epoch (0s) as a valid time X-Git-Tag: v1.1.0-pre1~237 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=c83ba91fcebd7e346e71ef155e7c618130c70111;p=public-inbox.git import: allow the epoch (0s) as a valid time Despite email not existing until 1971; "Jan 1, 1970 00:00:00" seems like a common default timestamp for some test emails to use as a Date: header. --- diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index f8d10037..1f831a7b 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -233,7 +233,7 @@ sub parse_date ($) { warn "bogus TZ offset: $zone, ignoring and assuming +0000\n"; $zone = '+0000'; } - $ts ||= time; + $ts = time unless defined $ts; $ts = 0 if $ts < 0; # git uses unsigned times "$ts $zone"; }