MENU
    Supported DATETIME_DIFF unit specifiers in Airtable
    • 18 Dec 2023
    • 1 Minute to read
    • Dark
    • PDF

    Supported DATETIME_DIFF unit specifiers in Airtable

    • Dark
    • PDF

    Article summary

    This article covers using the DATETIME_DIFF() to calculate the difference between two different date times in specified units to streamline your team's and organization's work.

    Introduction

    Plan availability

    All plan types 

    Platform(s)

    Web/Browser, Mac app, and Windows app 

    Related reading

    DATETIME_DIFF() in Airtable overview

    DATETIME_DIFF() overview

    NOTE

    If no unit is specified, or the specifier is not recognized by the function, then the output will default to seconds. If the unit specified is not recognized, the output will default to milliseconds.

    The DATETIME_DIFF() function will allow 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').

    supported DATETIME_DIFF() time units and specifiers

    NOTE

    If you're looking to use workdays as a unit for DATETIME_DIFF(), you may want to use the formula WORKDAY_DIFF() instead.

    Unit specifier

    Abbreviation

     'milliseconds' 

     'ms' 

     'seconds' 

     's' 

     'minutes' 

     'm' 

     'hours' 

     'h' 

     'days' 

     'd' 

     'weeks' 

     'w' 

     'months' 

     'M' 

     'quarters' 

     'Q' 

     'years' 

     'y' 

    NOTE

    When attempting to use DATETIME_DIFF() with static dates or dates that are formatted as strings you will want to nest the DATETIME_PARSE() function within your formula in order to turn the string into a readable date on Airtable's backend. Example: DATETIME_DIFF(DATETIME_PARSE('12/31/2021', "M/D/YYYY"), {Start Date},'d')


    Was this article helpful?