[Toybox] [PATCH] date: add --iso and the %:z output format.

enh enh at google.com
Sun Nov 15 11:10:18 PST 2020


On Sun, Nov 15, 2020, 00:53 Rob Landley <rob at landley.net> wrote:

> On 11/14/20 5:06 PM, enh via Toybox wrote:
> > I didn't know until implementing this that --iso is actually called
> > --iso-8601 and that GNU date will actually accept any prefix. --iso-8
> > works fine too. I've assumed that --iso (that I always used) and
> > --iso-8601 (as given in the documentation) are the only two that matter.
> > ---
>
> Please explain this line:
>
>       strcpy(out+4, out+3);
>

strftime only supports the -0800 style of time zone, so that moves the 00
up so we can insert the : and get -08:00.

Rob
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20201115/2fe17a05/attachment-0001.htm>


More information about the Toybox mailing list