GNU bug report logs -
#56524
doc: timezone offset conversion/info
Previous Next
Full log
Message #8 received at 56524 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
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).
[0001-parse-datetime-improve-doc-for-TZ-07-7-etc.patch (text/x-patch, attachment)]
This bug report was last modified 2 years and 339 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.