Expression Language Reference
    Preparing search index...
    • Calculates the number of days, months, or years between two dates. This function is useful in formulas where you need to calculate an age.

      Category: Date and time

      Parameters

      • start_date: any

        A date that represents the first, or starting date of a given period.

      • end_date: any

        A date that represents the last, or ending, date of the period.

      • unit: any

        The type of information that you want returned, where:

        • "Y": The number of complete years in the period.
        • "M": The number of complete months in the period.
        • "D": The number of days in the period.
        • "MD": The difference between the days in start_date and end_date. The months and years of the dates are ignored.
        • "YM": The difference between the months in start_date and end_date. The days and years of the dates are ignored
        • "YD": The difference between the days of start_date and end_date. The years of the dates are ignored.

      Returns number | Error