Re: [PATCH] tests: printf: provide explicit TZ start/end
From:
Martin D Kealey
Subject:
Re: [PATCH] tests: printf: provide explicit TZ start/end
Date:
Fri, 14 Jun 2024 13:34:28 +1200
On Fri, 14 Jun 2024 at 10:52, Robert Elz <kre@munnari.oz.au> wrote:
> | I also note a minor bug/issue with printf in Bash 5.3-alpha: the
> builtin
> | printf treats TZ=CET-1CEST,M3.5,M10.5/3 as if it were oddly-named UTC.
>
> That's user error, POSIX format requires 3 values after the M:
"User error" is not the only possible interpretation, even if "POSIX says
something else". (And I specifically said "issue" rather than "bug".) It's
an entirely reasonable *extension* to POSIX.
I only knew that the 2-value version was possible because it was
documented *and
recommended* when I started using it in 1988, with substantially the same
description in Ultrix, SunOS, Xenix, and SCO-Unix. In 1988 I used
TZ=NZST-12NZDT,M10.5,M3.1 but the next year (1989) changed to
TZ=NZST-12NZDT,M10.1,M3.3 and that remained unchanged until 2007, when it
changed to TZ=NZST-12NZDT,M9.5,M4.1. Obviously I've only *kept* using this
shorter format because *nothing* objected; in particular the GNU "date" and
"ls" and "touch" commands interpret these abbreviated timezone rules
according to this "extension" format. (Some time around 2014 I switched to
using the "named" timezones with simply TZ=NZ or TZ=Pacific/Auckland, but
I've occasionally used the old style when I needed to test behaviour in
"odd" time zones.)
To be clear, this isn't a bug report, but rather a feature request to
implement a common extension, and to interpret TZ=...,M*m.w* printf in line
with the rest of GNU.
-Martin