Вот простое решение, которое учитывает високосные годы:
# Input and output are both in milliseconds since the epoch;
# the output time is later than the input time by $n units, where
# the units are determined by $unit, one of the strings in `dict`.
def later($n; $unit):
def dict: { YEAR:0, MONTH:1, DAY:2, HOUR:3, MINUTE:4, SECOND:5, MIN:4, SEC:5};
gmtime
| .[dict[$unit]] += $n
| mktime ;
Тестирование
("2019-01-24" | strptime("%Y-%m-%d") | mktime)
| (later(2; "YEAR"), later(731; "DAY"))
| strftime("%Y-%m-%d")
Выход соответствует ожидаемому (поскольку 2020 год является високосным):
"2021-01-24"
"2021-01-24"
ключевое слово: addTime