9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: cinap_lenrek@felloff.net, 9front@9front.org
Subject: Re: [9front] date -t vs rfc3339 i which is correct:
Date: Tue, 10 Dec 2019 11:34:40 -0800	[thread overview]
Message-ID: <361ED9A9F4CE301DE0E938744EF73C41@eigenstate.org> (raw)
In-Reply-To: <241E176E19E4EE22ACD22FDCCFAA6E31@felloff.net>

> 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

The change looks good to me, but one question:

Is there anything that uses the output of 'date -t' and cares?
(How did we run into this?)



  reply	other threads:[~2019-12-10 19:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 19:17 cinap_lenrek
2019-12-10 19:34 ` ori [this message]
2019-12-10 19:48   ` Stanley Lieber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=361ED9A9F4CE301DE0E938744EF73C41@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    --cc=cinap_lenrek@felloff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).