dt1 = datetime("2021-08-21:13:30:00"); const dt2 = datetime("2021-01-30:21:30:00"); diffInMillisec(dt1, dt2); // 17510400000 const latest = datetime("2021-08-21"); const oldest = datetime("2021-01-30"); const middle = datetime("2021-04-30"); const datetimes = [latest, oldest, middle]; latestDateTime(datetimes); // latest oldestDateTime(datetimes); // oldest const dt = datetime("2021-08-21:13:30:00"); // { year: 2021, month: 8, day: 21, hour: 13, minute: 30, second: 0, millisecond: 0, } dt.add({ year: 1 }).substract({ month: 2 }); // { year: 2022, month: 6, day: 21, hour: 13, minute: 30, second: 0, millisecond: 0, }