- $zone ||= '+0000';
- # "-1200" is the furthest westermost zone offset,
- # but git fast-import is liberal so we use "-1400"
- if ($zone >= 1400 || $zone <= -1400) {
- warn "bogus TZ offset: $zone, ignoring and assuming +0000\n";
- $zone = '+0000';
- }
- ($ts, $zone);
+# Favors Received header for sorting globally
+sub msg_timestamp ($) {
+ my ($hdr) = @_; # Email::MIME::Header
+ my $ret;
+ $ret = msg_received_at($hdr) and return time_response($ret);
+ $ret = msg_date_only($hdr) and return time_response($ret);
+ wantarray ? (time, '+0000') : time;
+}
+
+# Favors the Date: header for display and sorting within a thread
+sub msg_datestamp ($) {
+ my ($hdr) = @_; # Email::MIME::Header
+ my $ret;
+ $ret = msg_date_only($hdr) and return time_response($ret);
+ $ret = msg_received_at($hdr) and return time_response($ret);
+ wantarray ? (time, '+0000') : time;