On 2024-02-09 00:39, Simon Josefsson wrote:
How about this (or gl-ctime?):
The
function does not set the external variables tzname, timezone or
daylight, see tzset(3).
I don't see how to implement that. We gotta call localtime or
localtime_r and they can set those variables.
Anyway, nobody should care about those variables nowadays. See:
https://data.iana.org/time-zones/theory.html#vestigial
The string length may be shorter for
years before 1000 and larger for years after 9999.
The length can also be longer for years before -999.
If WHEN cannot
be converted into a string,
If we're going to this much work, let's always convert WHEN to a string,
and never fail. This will simplify the caller, which is the point of
this API.
The function's Thread
safety attribute value is MT-Safe env locale.
The function is locale-independent, so why say "locale" here?
When you write this sort of thing, do you mean the properties must be
guaranteed on all platforms, or just on glibc?
Not sure it's worth the hassle of thinking out and documenting this
stuff portably. Too much depends on the underlying implementation.