mirror of
https://github.com/janet-lang/janet
synced 2024-11-29 03:19:54 +00:00
os/date: allow negative timestamps.
Why not? Even on 32-bit time_t systems this lasts until late 1901.
This commit is contained in:
parent
f013c6e48d
commit
efdb13f0c7
@ -621,8 +621,6 @@ static Janet os_date(int32_t argc, Janet *argv) {
|
||||
struct tm *t_info = NULL;
|
||||
if (argc) {
|
||||
int64_t integer = janet_getinteger64(argv, 0);
|
||||
if (integer < 0)
|
||||
janet_panicf("expected non-negative 64 bit signed integer, got %v", argv[0]);
|
||||
t = (time_t) integer;
|
||||
} else {
|
||||
time(&t);
|
||||
|
Loading…
Reference in New Issue
Block a user