From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Sat Sep 19 20:38:45 EDT 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 0b9ded8e (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Sat, 19 Sep 2020 17:38:36 -0700 (PDT) Message-ID: <355E3F0395C2F4AF941590B6BCBEBBA3@eigenstate.org> To: 9front@9front.org Subject: Re: [9front] Upas: Complete date library conversion. Date: Sat, 19 Sep 2020 17:38:35 -0700 From: ori@eigenstate.org In-Reply-To: <4A5FA36F176704A4A945E80A3752EDBA@eigenstate.org> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: cache method-oriented framework >> This patch completes the conversion to our new date and >> time APIs. Needs careful review and testing. The imap >> part seems to be working. I'm waiting on vultr to unblock >> port 25 so I can test out the SMTP part of the patch. > > One thing to note: This changes the date formats so that > timezones are unambiguous, using the +HHMM offset syntax. Oh. This goes with one change to libc: diff -r 730a2ee35853 sys/man/2/tmdate --- a/sys/man/2/tmdate Thu Sep 17 16:11:10 2020 -0700 +++ b/sys/man/2/tmdate Sat Sep 19 17:38:18 2020 -0700 @@ -135,6 +135,7 @@ .TP .B ? When parsing, this makes the following argument match fuzzily. +When formatting, this is ignored. Fuzzy matching means that all formats are tried, from most to least specific. For example, .I ?M diff -r 730a2ee35853 sys/src/libc/port/date.c --- a/sys/src/libc/port/date.c Thu Sep 17 16:11:10 2020 -0700 +++ b/sys/src/libc/port/date.c Sat Sep 19 17:38:18 2020 -0700 @@ -428,6 +428,9 @@ switch(c0){ case 0: break; + /* Ignore '?' so we can share parse and format strings */ + case '?': + continue; case 'Y': switch(w){ case 1: n += fmtprint(f, "%*d", pad, tm->year + 1900); break;