groff
[Top][All Lists]
Advanced

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

[PATCH] environment variable to make groff use UTC


From: G. Branden Robinson
Subject: [PATCH] environment variable to make groff use UTC
Date: Wed, 16 Dec 2020 12:12:54 +1100
User-agent: NeoMutt/20180716

At 2020-12-16T11:35:12+1100, G. Branden Robinson wrote:
> What do people think about a GROFF_USE_UTC environment variable that
> causes troff to call gmtime() instead of localtime()?

Here's a straw-man implementation.

As part of this I deleted a James Clark comment from 1992; any version
of g++ that was "old" then is certainly unsupported now, but more
importantly I don't understand what was idiomatically wrong with the
statement as it was.  Automatic type inference (through overloading of
the "auto" keyword) was a much, much later development of C++.

Perhaps a better C++ programmer than I can explain it to me.

Anyway, the diff is attached and here is the patch in action.

$ cat EXPERIMENTS/get_time.groff
.af year 0000
.af mo 00
.af dy 00
.af hours 00
.af minutes 00
.af seconds 00
.tm \n[year]-\n[mo]-\n[dy] \n[hours]:\n[minutes]:\n[seconds]
$ alias tg
alias tg='./build/test-groff'
$ GROFF_USE_UTC=1 tg EXPERIMENTS/get_time.groff
2020-12-16 00:55:03
$ GROFF_USE_UTC= tg EXPERIMENTS/get_time.groff
2020-12-16 00:55:06
$ tg EXPERIMENTS/get_time.groff
2020-12-16 11:55:09

Thoughts?

Regards,
Branden

Attachment: groff_use_utc.diff
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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