On Sun, 2016-03-27 at 02:34 -0600, Bob Proulx wrote:
> Ben Hutchings wrote:
> > 
> > $  readlink /etc/localtime
> > /usr/share/zoneinfo/Europe/London
> I assume that your locale is set to en_GB.UTF-8?  Could you provide
> the output of locale so that we could see the other settings?  I am
> interested in LC_TIME and LC_ALL particularly.

LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="C.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="C.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

[...]
> > This caused an upgrade of tzdata to fail for me.
> It doesn't seem to me be a problem with date.  Looking briefly at the
> tzdata postinst I see this:
> 
>   set -e
>   ...
>     TZBase=$(LC_ALL=C TZ=UTC0 date)
>     UTdate=$(LC_ALL=C TZ=UTC0 date -d "$TZBase")
>     TZdate=$(unset TZ ; LANG=C date -d "$TZBase")
> 
> Initially I don't see how that can fail but I may be missing
> something.  Can you provide any more information?
> 
> I am probably missing something but I don't see a way for it to fail.
> 
>     TZBase=$(LC_ALL=C TZ=UTC0 date)
> 
> That sets LC_ALL=C and therefore will have the standard format.
> (I wish it used date -R format instead.)

Yes, I was going to propose that change to tzdata before I realised
that it was already selecting a standard format.

[...]
> In all three cases it was able to parse that date string okay.  I wish
> it set LC_ALL instead of LANG however so as to remove any doubt.
> 
> What am I missing?

To reproduce this I think you'll need to select a date/time around the
DST transition in your time zone, or override TZ for the last command.

Try this:

TZBase=$(LC_ALL=C TZ=UTC0 date -d '2016-03-27 01:00')
UTdate=$(LC_ALL=C TZ=UTC0 date -d "$TZBase")
TZdate=$(TZ=Europe/London ; LANG=C date -d "$TZBase")

Ben.

-- 
Ben Hutchings
Beware of bugs in the above code;
I have only proved it correct, not tried it. - Donald Knuth

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to