Web lists-archives.com

Re: date(1) in stretch and buster




On Wed 10 Apr 2019 at 13:26:39 (+0200), Vincent Lefevre wrote:
> On 2019-04-09 13:28:40 -0500, David Wright wrote:
> > On Tue 09 Apr 2019 at 15:38:43 (+0200), Vincent Lefevre wrote:
> > > On 2019-04-08 18:26:23 +0300, Reco wrote:
> > > > stretch$ TZ=UTC date
> > > > Mon Apr  8 15:22:02 UTC 2019
> > > > buster$ TZ=UTC date
> > > > Mon 08 Apr 2019 03:22:04 PM UTC
> > > 
> > > This is unrelated to your issue, but note that the correct TZ string
> > > for UTC is "UTC0", not "UTC". See
> > > 
> > >   http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html
> > 
> > I think it's unwise to write that here. AIUI GNU/linux date uses the
> > so-called 3rd format for timezones, which points into the time zone
> > database. There's an entry in that database for UTC, but not for UTC*.
> > And, of course, what would the civil name be for date to label that
> > timezone with? You can't use just "UTC".
> 
> UTC0 appears to be safer. Here's what I got in the past:
> 
> patate:~> TZ=UTC date; TZ=UTC0 date
> Mon Aug 13 00:35:53 CEST 2018
> Sun Aug 12 22:35:53 UTC 2018
> 
> just because a script was writing to /etc/localtime.

If that's the way you "fix" your broken configuration, why not use
a more indicative string so that people know your system's broken:

$ date; TZ=UTC date; TZ=UTC0 date; TZ=XXX date; TZ=XXX0 date
Wed Apr 10 10:48:36 CDT 2019
Wed Apr 10 15:48:36 UTC 2019
Wed Apr 10 15:48:36 UTC 2019
Wed Apr 10 15:48:36 XXX 2019
Wed Apr 10 15:48:36 XXX 2019
$ 

Cheers,
David.