Jan. 26, 2018
3:39 p.m.
J William Piggott wrote:
Rather than requiring applications to "call localtime and gmtime ... and subtract the results by hand", why couldn't the function(s) used by tzset for the tm_gmtoff value be made available for applications?
You don't need functions. All you need is tm_gmtoff; it's simple and easy to explain, and is a widely-used extension to POSIX.
Perhaps it should be documented in the glibc manual and elsewhere?
The glibc manual already documents tm_gmtoff, as do manuals for other operating systems that have it. Unfortunately tm_gmtoff is not standardized by C or POSIX, perhaps because standardizers mistakenly thought that strftime %z was enough.