9front - general discussion about 9front
 help / color / mirror / Atom feed
From: ori@eigenstate.org
To: ori@eigenstate.org, magma698hfsp273p9f@icebubble.org, 9front@9front.org
Subject: Re: [9front] Re: Date and time handling.
Date: Sun, 3 May 2020 21:08:04 -0700	[thread overview]
Message-ID: <1CE411CAAB15E7AEBECDD117C02455EB@eigenstate.org> (raw)
In-Reply-To: <301873E74608771F391ED0A660DDCFF7@eigenstate.org>

>> Thanks for the review. Good questions and comments!
>> 
> 
> And thanks to joe9 for adding a bunch of test cases, which
> now all pass. I think the code is ready for testing.
> 
> The next step, if there aren't any objections, will be to
> merge the `struct Tmd` with libc's `struct Tm`, and move
> this library over to use it.
> 
> Once we've got some experience and are happy with this, I'd
> like to commit this to 9front and move utilities like date
> over to it.

I started rewriting seconds(1), trying to loop together a
mass of permutations of date formats, and decided I hate it.

I think we should do two things with seconds:

1) Pick a common list of date formats we should try,
   one after the other.

2) add a '-f' option (same for date) that will accept a libdate
   format, instead of looping through them all and trying them
   one by one.

What formats do people use with seconds? I'd like to propose
the following, cribbed from Go's constant formats, but with
the addition of RFC5322

asctime:
	WWW MMM DD hh:mm:ss YYYY
RFC5322:
    Note: there are a lot of variants, and I'm considering
	      adding a '?' modifier  to indicate fuzzy parsing,
	      where '1, 01, Jan, January' would all match '?M'

	WWW DD MMM YYYY hh:mm:ss Z
	WWW DD MMMM YYYY hh:mm:ss Z
	WWWW DD MMM YYYY hh:mm:ss Z
	WWWW DD MMMM YYYY hh:mm:ss Z
	WWW, DD-MM-YY hh:mm:ss Z
	WWW, DD-MM-YY hh:mm:ss Z
	WWW, DD-MMM-YY hh:mm:ss Z
	WWW, DD-MMMM-YY hh:mm:ss Z
	WWWW, DD-MM-YY hh:mm:ss Z
	WWWW, DD-MM-YY hh:mm:ss Z
	WWWW, DD-MMM-YY hh:mm:ss Z
	WWWW, DD-MMMM-YY hh:mm:ss Z
RFC822/RFC8222:
	DD MMM YY hh:mm ZZZ
	DD MMM YY hh:mm Z

RFC850:
	WW, DD-MMM-06 hh:mm:ss MST
RFC1123:
	WWW, DD MMM YYYY hh:mm:ss ZZZ
RFC1123Z:
	WWW, DD MMM YYYY hh:mm:ss ZZ
RFC3339:
	YYYY-01-DDThh:mm:ss[Z]ZZ



  reply	other threads:[~2020-05-04  4:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08  3:56 ori
2020-04-08  6:48 ` [9front] " Steve Simon
2020-04-09 14:12   ` ori
2020-04-12  6:20   ` ori
2020-04-12 18:27 ` magma698hfsp273p9f
2020-04-13  0:36   ` [9front] " ori
2020-04-16 20:40     ` ori
2020-05-04  4:08       ` ori [this message]
2020-05-05 17:29         ` magma698hfsp273p9f

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=1CE411CAAB15E7AEBECDD117C02455EB@eigenstate.org \
    --to=ori@eigenstate.org \
    --cc=9front@9front.org \
    --cc=magma698hfsp273p9f@icebubble.org \
    /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).