[tz] make rearguard_tarballs fails on macOS

Robert Elz kre at munnari.OZ.AU
Sat Oct 17 21:28:13 UTC 2020

    Date:        Sat, 17 Oct 2020 11:19:10 -0700
    From:        Paul Eggert <eggert at cs.ucla.edu>
    Message-ID:  <db471bb7-967f-7805-f850-cce37c93e098 at cs.ucla.edu>

  | However, in 2011 the POSIX requirement

Yes, saw that after I sent the previous message.

So, I did write the code to handle it, and it is ugly (though could be
uglier I suppose).  Not yet committed to NetBSD, still pondering the
real need (blind obedience to what POSIX mandates is not a goal of the
project - there are several places where we simply refuse).

  | By the way, the "human" format is specified in RFC 3339 section 5.6:
  | https://tools.ietf.org/html/rfc3339#section-5.6

Our "human format" is much more flexible than that, it allows stuff like
"midnight tomorrow" or "three weeks ago" (or "3 weeks ago"), and further
allows those kinds of things to be combined with more of the same
("next sunday 5 seconds ago") and/or with a more precise format
(like the ISO variant, but also asctime output, rfc822 format, cvs format, ...)
to set a base time rather than now (or some other input time_t), which
is then modified.

  | and if I had been part of the POSIX deliberations I would have
  | insisted that it also allow " " instead of "T".

It does.   At least in touch:


    · YYYY are at least four decimal digits giving the year.

    · MM, DD, hh, mm, and SS are as with -t time.

    · T is the time designator, and can be replaced by a single <space>.

    · [.frac] and [,frac] are either empty, or a <period> ('.') or a <comma>
       (',') respectively, followed by one or more decimal digits, specifying a
       fractional second.

    · [tz] is either empty, signifying local time, or the letter 'Z',
       signifying UTC.   If [tz] is empty, the resulting time shall be
       affected by the value of the TZ environment variable.

Note the third bullet point.

We extend that by allowing less than 4 Y digits, so (as meaningless as
it is) '513-04-23 16:20:23Z' means some April date in the Dark Ages.
We don't allow BC though...   We also ignore the fraction (in all formats
where it is permitted) - parsedate() is ancient, and returns a time_t
which has no way to represent fractional seconds.   One day I'll make
a version which returns a bintime or a timespec or something.

  | GNU 'date' supports the "human" format as an extension to POSIX,
  | and I assume  NetBSD 'date' will continue to do so too.

Yes.   That uses parsedate() as well.   Several things do.


More information about the tz mailing list