From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from duke.felloff.net ([216.126.196.34]) by ewsd; Tue Dec 10 14:17:35 EST 2019 Message-ID: <241E176E19E4EE22ACD22FDCCFAA6E31@felloff.net> Date: Tue, 10 Dec 2019 20:17:25 +0100 From: cinap_lenrek@felloff.net To: 9front@9front.org Subject: Re: [9front] date -t vs rfc3339 i which is correct: In-Reply-To: 14D90BE78DD6FC8C05C78941DB9D6103@ewsd.inri.net 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: patented full-stack-oriented hardware template my interpretation is that this rfc3339 is a SUBSET of iso-8601 and we hit edge case in iso-8601 that is outside of rfc3339. we'r correct for iso 8601 but not for rfc3339. i think this should be changed so we cover both specifications and make date -t more widely usefull. --- a/sys/src/cmd/date.c Mon Dec 09 18:08:02 2019 +0100 +++ b/sys/src/cmd/date.c Tue Dec 10 20:15:42 2019 +0100 @@ -15,7 +15,7 @@ char* isodate(Tm *t) { - static char c[25]; /* leave room to append isotime */ + static char c[26]; /* leave room to append isotime */ snprint(c, 11, "%04d-%02d-%02d", t->year + 1900, t->mon + 1, t->mday); return c; @@ -39,7 +39,7 @@ c[9] = '-'; tz = -tz; } - snprint(c+10, 5, "%02d%02d", tz / 60, tz % 60); + snprint(c+10, 6, "%02d:%02d", tz / 60, tz % 60); } else { c[9] = 'Z'; c[10] = 0; -- cinap