Skip to main content

atoti.date_diff(from_date, to_date, /, *, unit=‘days’)

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 ( _DateConstantOrVariableMeasureConvertible) – The starting date.
    • to_date ( _DateConstantOrVariableMeasureConvertible) – The end date.
    • unit (Literal [ ‘seconds’ , ‘minutes’ , ‘hours’ , ‘days’ , ‘weeks’ , ‘months’ , ‘years’ ]) – The difference unit. Seconds, minutes, and hours are only allowed if the dates contain time information.
  • Return type: MeasureDefinition

Example