Public bug reported:

Ubuntu 20.04.1 LTS

groff's date & time (visible in variable \n[hours] for example) are
always in UTC, not the local time.  The TZ environment variable is
ignored.

The upstream version doesn't have this bug; it honors TZ as it should.
I downloaded and built from upstream source the exact same version of
groff that the Ubuntu package claims to contain, and it works.  But the
Ubuntu binary does not work in this respect.

dpkg-query -l groff says: 1.22.4-4build1 amd64

Upstream source code is at
http://ftp.gnu.org/gnu/groff/groff-1.22.4.tar.gz

STEPS TO REPRODUCE: 
  1. Run the following script

#!/bin/sh
#GROFF=/home/jima/src/groff-1.22.4/inst/bin/groff
GROFF=/usr/bin/groff
echo "Using $GROFF"
for varlist in \
   'PATH=/bin:/usr/bin' \
   'PATH=/bin:/usr/bin TZ=UTC' \
   'PATH=/bin:/usr/bin TZ=America/New_York' \
   'PATH=/bin:/usr/bin TZ=America/Los_Angeles' \
; do
  echo "--------------------------------------"
  eval "env -i $varlist /bin/sh" <<SHELLEOF
#(set -x; env)
echo "TZ is \${TZ:-(unset)}"
echo -n "date  says: "; date +'%Y-%m-%d %H:%M:%S'
$GROFF <<'GEND' 2>&1 >/dev/null
.tm groff says: \n[year]-\n[mo]-\n[dy] \n[hours]:\n[minutes]:\n[seconds]
GEND
SHELLEOF
done

***
Here is output on my system (notice that \n[hours] is always in UTC regardless 
of TZ):

Using /usr/bin/groff
--------------------------------------
TZ is (unset)
date  says: 2020-12-15 16:54:38
groff says: 2020-12-16 0:54:38
--------------------------------------
TZ is UTC
date  says: 2020-12-16 00:54:38
groff says: 2020-12-16 0:54:38
--------------------------------------
TZ is America/New_York
date  says: 2020-12-15 19:54:38
groff says: 2020-12-16 0:54:38
--------------------------------------
TZ is America/Los_Angeles
date  says: 2020-12-15 16:54:38
groff says: 2020-12-16 0:54:38

***
Here is output using groff built from upstream source:

Using /home/jima/src/groff-1.22.4/inst/bin/groff
--------------------------------------
TZ is (unset)
date  says: 2020-12-15 16:55:05
groff says: 2020-12-15 16:55:5
--------------------------------------
TZ is UTC
date  says: 2020-12-16 00:55:05
groff says: 2020-12-16 0:55:5
--------------------------------------
TZ is America/New_York
date  says: 2020-12-15 19:55:05
groff says: 2020-12-15 19:55:5
--------------------------------------
TZ is America/Los_Angeles
date  says: 2020-12-15 16:55:05
groff says: 2020-12-15 16:55:5

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: groff 1.22.4-4build1
ProcVersionSignature: Ubuntu 5.4.0-54.60-generic 5.4.65
Uname: Linux 5.4.0-54-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.13
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Tue Dec 15 16:40:41 2020
InstallationDate: Installed on 2020-03-24 (266 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
SourcePackage: groff
UpgradeStatus: Upgraded to focal on 2020-05-16 (213 days ago)

** Affects: groff (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1908333

Title:
  Ubuntu's groff ignores TZ (but upstream works)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/groff/+bug/1908333/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to