Files
jq/tests
itchyny 5c001b18d7 Fix mktime/0 to allow the last two seconds of 1969 (#3671)
The mktime/0 function failed for 1969-12-31T23:59:59Z with "invalid
gmtime representation", because its result -1 is also the failure value
of timegm(), and for 1969-12-31T23:59:58Z with "mktime not supported on
this platform", because of a leftover check for -2.

Tell a failure apart from the valid result -1 by tm_wday, which is set
to -1 before the conversion and overwritten only on success, and remove
the check for -2. Now `-2, -1 | gmtime | mktime` round-trip to -2 and -1,
as do normalized inputs such as [1970,0,0,23,59,59,0,0], which gives -1.
Inputs that the platform rejects, such as years before 1900 on macOS,
still fail with "invalid gmtime representation".
2026-11-02 16:08:10 +09:00
..
…
…
…
2024-08-22 08:07:24 +09:00