bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug#56524: doc: timezone offset conversion/info


From: Paul Eggert
Subject: Re: bug#56524: doc: timezone offset conversion/info
Date: Tue, 12 Jul 2022 17:20:59 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 7/12/22 15:57, Karl Berry wrote:

$ TZ=UTC-4 date -d 'TZ="UTC" 2022-07-24 15:00'

This doesn't mean what you want, because TZ=UTC-4 means "My time zone is abbreviated 'UTC', and it's four hours east of Greenwich" which is not a useful setting.

You're not the first person to run afoul of POSIX TZ strings, which are poorly designed. I installed the attached patch to Gnulib to give another example, which I hope clarifies things a bit. I'll cc this email to bug-gnulib since the problem is in Gnulib not Coreutils proper.

If the offset syntax is documented anywhere, I couldn't find it. Sorry.

It's documented in the glibc manual, and this part of the Coreutils manual (actually, taken from Gnulib) has a cross-reference to that.

BTW, in neither case did --debug clarify anything for me. In fact, it
confused me more, because the output seemingly did not include anything
about the offset at all, just reporting "UTC".

It'd be nice if --debug could diagnose invalid TZ settings. However, this would likely require glibc support along the lines of what's in tzcode and NetBSD (the tzalloc function).

Attachment: 0001-parse-datetime-improve-doc-for-TZ-07-7-etc.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]