[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
groff_use_utc.diff
Description: Text Data
signature.asc
Description: PGP signature
- How to make groff use local timezone?, Jim Avera, 2020/12/13
- Re: How to make groff use local timezone?, G. Branden Robinson, 2020/12/15
- [PATCH] environment variable to make groff use UTC,
G. Branden Robinson <=
- Re: How to make groff use local timezone?, Colin Watson, 2020/12/16
- [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), G. Branden Robinson, 2020/12/20
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), Dave Kemper, 2020/12/21
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), Deri, 2020/12/21
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), Dave Kemper, 2020/12/21
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), Deri, 2020/12/21
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), G. Branden Robinson, 2020/12/21
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), Wim Stockman, 2020/12/22
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), Deri, 2020/12/22
- Re: [PROPOSAL] time zones and reproducible builds (was: How to make groff use local timezone?), Colin Watson, 2020/12/23