Weird timezone offsets throws tin date parser off
gmane.os.netbsd.ports.arm at news.gmane.io (and other groups there, that gate netbsd mailing lists) has messages from one guy with what I assume to be an artisanal show-off TZ offset. E.g.: From: "William A. Mahaffey III" <wam@hiwaay.net> Message-ID: <dfced155-d1fb-6de1-c76c-326b1d18e92d@hiwaay.net> Date: Wed, 25 May 2016 10:59:40 -0453.75 NNTP-Posting-Date: Wed, 25 May 2016 19:50:39 +0000 (UTC) Original-Received: from kabini1.local (dynamic-216-186-240-4.knology.net [216.1 86.240.4] (may be forged)) \011(authenticated bits=0) \011by fly.hiwaay.net (8.13.8/8.13.8/fly) with ESMTP id u4PFsA5s004781 \011(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); \011Wed, 25 May 2016 10:54:11 -0500 This throws off tin's date parser and it tells me (in the article view), that the article is from Wed, 01 Jan 2070 02:59:59 and sorts the article/thread in the date sort order accordingly, so a bunch of threads with reply from that person are sorted at the end of the list of articles/threads. It would be nice if the date parsing code was a bit more conservative. Ignoring bad TZ offset would give the date that is only a few hours off, not several decades. Thanks in advance! -uwe
On Mon, Jun 23, 2025 at 01:35:35AM +0300, Valery Ushakov wrote:
gmane.os.netbsd.ports.arm at news.gmane.io (and other groups there, that gate netbsd mailing lists) has messages from one guy with what I assume to be an artisanal show-off TZ offset. E.g.:
From: "William A. Mahaffey III" <wam@hiwaay.net> Message-ID: <dfced155-d1fb-6de1-c76c-326b1d18e92d@hiwaay.net> Date: Wed, 25 May 2016 10:59:40 -0453.75
RFC 5322 3.3 | zone = (FWS ( "+" / "-" ) 4DIGIT) / obs-zone -> illegal (yes, I've also cheked obs-zone in the same RFC, section 4.3)
This throws off tin's date parser and it tells me (in the article view), that the article is from
Wed, 01 Jan 2070 02:59:59
the "problem" is that parsdate() either returns a t_time() value (date is valid) or -1 (date is invalid). the later is turned into (time_t) 0 to have a valid date when assigned to the articles date field (wich basically holds a time_t value) and that is 1970-01-01 00:00:00 +0000 (UTC).
It would be nice if the date parsing code was a bit more conservative. Ignoring bad TZ offset would give the date that is only a few hours off, not several decades.
but where do you draw the line here and at what point is a defective date header defective? is a day with 64 minutes per hour or 26 hours ok? or a february with 30 days? no? why not?
participants (2)
-
Urs Janßen -
Valery Ushakov