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

2020-11-15 Thread Rob Landley


On 11/15/20 1:10 PM, enh wrote:
> 
> 
> On Sun, Nov 15, 2020, 00:53 Rob Landley  > 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. 

Let me rephrase:

Pleee...

I switched it to memmove().

Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


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

2020-11-15 Thread enh via Toybox
On Sun, Nov 15, 2020, 00:53 Rob Landley  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
>
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net


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

2020-11-15 Thread Rob Landley
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);

Rob
___
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net