Skip to main content
atoti.date_diff(
    from_date: _DateConstantOrVariableMeasureConvertible,
    to_date: _DateConstantOrVariableMeasureConvertible,
    /,
    *,
    unit: Literal[‘seconds’, ‘minutes’, ‘hours’, ‘days’, ‘weeks’, ‘months’, ‘years’] = 'days',
) → MeasureDefinition
Return a measure equal to the difference between two dates. The measure evaluates to None if one of the dates is None.

Parameters

from_date

The starting date.

to_date

The end date.

unit

The difference unit. Seconds, minutes, and hours are only allowed if the dates contain time information.