diffWeeks()
Returns the number of whole weeks between two dates. The result is positive when date2 is after date1, and negative when date2 is before date1.
Syntax
diffWeeks(date1, date2)
Parameters
Return Type
NumberNumber
The number of whole weeks between the two dates. Partial weeks are not counted.
Examples
diffWeeks('2025-01-01', '2025-12-31')
- Returns 52.
diffWeeks('2025-01-01', '2025-01-08')
- Returns 1 because there is exactly one full week between the two dates.
Related Carrot
- diffDays()diffDays() - Returns the number of days between two dates
- diffMonths()diffMonths() - Returns the number of whole months between two dates
- diffYears()diffYears() - Returns the number of whole years between two dates
