diff --git a/src/builtin.c b/src/builtin.c index 69e9b07214..da4a770fac 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -1602,8 +1602,6 @@ static int jv2tm(jv a, struct tm *tm) { static jv f_mktime(jq_state *jq, jv a) { if (jv_get_kind(a) != JV_KIND_ARRAY) return ret_error(a, jv_string("mktime requires array inputs")); - if (jv_array_length(jv_copy(a)) < 6) - return ret_error(a, jv_string("mktime requires parsed datetime inputs")); struct tm tm; if (!jv2tm(a, &tm)) return jv_invalid_with_msg(jv_string("mktime requires parsed datetime inputs")); diff --git a/tests/jq.test b/tests/jq.test index 88cd5d8b9f..446ee36952 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -1610,6 +1610,10 @@ strftime("%Y-%m-%dT%H:%M:%SZ") [2024,2,15] "2024-03-15T00:00:00Z" +mktime +[2024,8,21] +1726876800 + gmtime 1425599507 [2015,2,5,23,51,47,4,63]