Plan Availability | All plan types |
Required permissions | Owner / Creator - Can add, delete, duplicate, rename, and customize fields |
Platform(s) | Web/Browser, Mac app, and Windows app (with some additional limited support on mobile) |
DATETIME_DIFF() in Airtable overview
The DATETIME_DIFF() function allows you to calculate the difference between two different datetimes in specified units.
Each specifier has a corresponding abbreviation that works like the long-form version of the specifier—.DATETIME_DIFF(Date, Date2, 'y')
—resulting in same output as DATETIME_DIFF(Date, Date2, 'years')
.
Note
The output will default to seconds if no unit is specified or the function does not recognize the specifier.
The output will default to milliseconds if the unit specified is not recognized.
The DATETIME_DIFF() function allows you to calculate the difference between two different datetimes in specified units. Each specifier has a corresponding abbreviation which will work the same as the longform version of the specifier, e.g. DATETIME_DIFF(Date, Date2, 'y')
will have the same output as DATETIME_DIFF(Date, Date2, 'years')
.
Note
We encourage using the WORKDAY_DIFF() instead of DATETIME_DIFF() if you want to use workdays as a unit.
Be sure to nest the DATETIME_PARSE() function within your formula to turn the string into a readable date when attempting to use DATETIME_DIFF() with static dates or dates that are formatted as strings.
supported DATETIME_DIFF() time units and specifiers:
Unit specifier | Abbreviation |
---|---|
'milliseconds' | 'ms' |
'seconds' | 's' |
'minutes' | 'm' |
'hours' | 'h' |
'days' | 'd' |
'weeks' | 'w' |
'months' | 'M' |
'quarters' | 'Q' |
'years' | 'y' |