# Calculate Date Difference

calculate_date_difference Parameters

Required Parameters

  1. start_date (string, YYYY-MM-DD) — the start of the date range. Should be earlier than end_date.
  2. end_date (string, YYYY-MM-DD) — the end of the date range. Should be later than start_date.

Optional Parameters

  1. debug (boolean) — default false.

Returns

The amount of time between start_date and end_date. If end_date falls before start_date, the result will be negative.

When to Use calculate_date_difference

  • You need to determine how many days apart two dates are
  • Describing timelines or scheduling follow-ups
  • Determining how long ago something happened relative to another date
  • Anchoring a date range calculation once you already have both endpoints (e.g., after calling get_current_date for "today")

Did this page help you?