Date difference / add days
calc_date_diffCalculate days, weeks, months, working days, or weekend days between two dates, or add/subtract days, business days, weeks, months, or years to a date with weekday and Hijri results.
Instructions
Two date jobs. difference: days between two dates (optionally counting the end day), as years/months/days, weeks, whole months, working days and weekend days for a chosen weekend (Fri–Sat default, Sat–Sun, Fri only, Sun only; public holidays are not counted). add: add or subtract days, business days, weeks, months or years to a date (month ends clamp: Jan 31 + 1 month = Feb 28/29). Results include the weekday and Umm al-Qura Hijri date. Dates are ISO YYYY-MM-DD; for Hijri ⇄ Gregorian conversion use calc_hijri. Web version: https://s3eidat.github.io/date-diff/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | difference: end date YYYY-MM-DD (default today). | |
| date | No | add: the starting date YYYY-MM-DD (default today). | |
| mode | No | difference between two dates, or add/subtract an amount. | difference |
| unit | No | add: unit of amount. | days |
| start | No | difference: start date YYYY-MM-DD (default today). | |
| amount | No | add: how many units to add (use subtract to go back). | |
| weekend | No | Weekend days skipped by working-day counts. | fri-sat |
| subtract | No | add: go back in time instead. | |
| inclusive | No | difference: count the end date too. |