How to Use and Compute Dates & Times in Airtable Formulas


Airtable has many built-in functions to get the dates and times of different events as well as to compute durations, add durations to dates, compare dates and times, and more. This post contains two parts: the first part is a table that lists all of the important date & time functions that are built into Airtable, together with descriptions and instructions on how to use them, and the second part of this blog post is a series of answers to common questions about how to effectively work with dates and times in Airtable.

FunctionInputs & OutputsNotes
NOW()Inputs: None

Output: current datetime (e.g. “2/27/2022 5:17pm”)
TODAY()Inputs: None

Output: current date (e.g. “2/27/2022”)
TODAY() is like NOW()
except it doesn’t include
time of day information
CREATED_TIME()Inputs: None

Output: The datetime when the record containing
the output cell was created
LAST_MODIFIED_TIME()Inputs: None

Output: The datetime of the last user
modification to a non-computed cell of that record
IS_AFTER( date_1, date_2)Inputs (2): Can be dates and/or datetimes

Output: 1 if date_1 is after date_2, otherwise 0
If one input is a date and the other is a datetime, then the date will be interpreted as a datetime with time 12am

Example: If date_1 = “2/28/2022 10:15am”
and date_2 = “2/28/2022”, then
IS_AFTER(date_1, date_2) = 1
IS_BEFORE( date_1, date_2)Inputs (2): Can be dates and/or datetimes

Output: 1 if date_1 is before date_2, otherwise 0
IS_SAME( date_1, date_2, “units”)Inputs (2-3):
– date_1 (may be a date or datetime)
– date_2 (may be a date or datetime)
– “units” is an optional third input that can be left out if desired; if included, it is a unit of time written as a string with quotes (e.g. “years”)

Output: 1 if date_1 is the same as date_2 (up to one “unit” of granularity, if “units” is included as an input); otherwise 0
Common units of time:
– “minutes” (or “m”)
– “hours” (or “h”)
– “days” (or “d”)
– “weeks” (or “w”)
– “months” (or “M”)
– “quarters” (or “Q”)
– “years” (or “y”)

Airtable also supports “seconds” and “milliseconds”, but these typically are more granular than most people will find useful

Any changes to supported units should be
reflected on this page
DATEADD( date, number, “units”)Inputs (3):
– date or datetime
– a positive integer (e.g. 1, 2, 23, etc)
– “units” (one of the same options as above)

Output: date or datetime that results from adding the specified number of time units to the specified date or datetime

Example:
DATEADD(“3/1/2022”, 1, “months”)
= “4/1/2022”
DATETIME_DIFF( date_1, date_2, “units”)Inputs (3):
– date_1 (may be a date or datetime)
– date_2 (may be a date or datetime)
– “units” (one of the same options as above)

Output: a number (computed as the number of time “units” between date_1 and date_2)
TONOW( date )
or
FROMNOW( date )

*The two functions are equivalent
Input (1): A date

Output: A duration of time written as a number plus a unit, representing the time between NOW() and the specified input date.

E.g. “20 hours” or “18 days” or “2 months”
DAY( date )Input (1): A date or datetime

Output: A number from the range 1-31 representing the day of the month for the input date
MONTH( date )Input (1): A date or datetime

Output: A number from the range 1-12 representing the month (1=January, 12=December)
YEAR( date )Input (1): A date or datetime

Output: The four-digit year of the input date or datetime
HOUR( datetime )Input (1): A datetime

Output: A number from the range 0-23 representing the hour of the specified datetime (0=12am, 23=11pm)
WEEKDAY( date )Input (1): A date or datetime

Output: A number from the range 0-6 representing the day of the week (0=Sunday, 6=Saturday)
DATETIME_FORMAT( datetime, “format-specifier”)Inputs (2):
– a date or datetime
– a character or string, with quotes, that represents a specified way to format a date or datetime (e.g. “M”, “d”, “ddd”, etc)

Output: A string of text that represents a date or datetime in the specified format

Example:
DATETIME_FORMAT(“11/22/2022”, “M”) = 11

Example 2:
DATETIME_FORMAT(“11/22/2022”, “D”) = 22

Example 3:
DATETIME_FORMAT(“11/22/2022”, “Do”) = “22nd”
Common Useful Format Specifiers:

“MMM” –> “Jan”, “Feb”, etc (3-letter month abbreviation)

“MMMM” –> “January”, “February”, etc (full month name)

“dd” –> “Su”, “Mo”, etc (2-letter day of the week abbreviation)

“ddd” –> “Sun”, “Mon”, etc (3-letter day of the week abbreviation)

“dddd” –> “Sunday”, “Monday”, etc (full day of the week name)

“YY” –> last two digits of year (e.g. “89” or “02”)

“Z” –> timezone relative to GMT, including colons (e.g. “-07:00” or “+3:00”)

“ZZ” –> timezone relative to GMT, not including colons (e.g. “-0700” or “+0300”)

“X” –> Unix timestamp (in seconds)

“L” –> display date in format “MM/DD/YYYY”

“LL” –> display date in format “<month-name> day, YYYY” (e.g. “June 8, 2023”)

You can find a complete list of all format specifier codes here
Airtable Date & Time Functions

There are a few additional datetime functions available in Airtable that I have not included in the reference table above since they aren’t generally as useful. However, if you need to look them up, you can find them described on this page.

How can I compare two dates in Airtable?

The most useful functions for comparing two dates in an Airtable formula are the IS_AFTER, IS_BEFORE, and IS_SAME functions. You can find descriptions of how to use each of these functions in the reference table above.

How do you calculate a certain number of days after a known date in Airtable?

To find the date that is a certain number of days after a known date, use the DATEADD function which is built into Airtable. You can find a description for this function and how to use it in the reference table above.

How do you use Airtable datetime functions in Airtable Automations?

Unfortunately, you can’t use any of the built-in Airtable datetime functions directly within an Airtable Automation. However, you can usually find a work-around by creating extra computed fields which run the Airtable datetime functions you need and then referencing those fields from your Airtable Automation.

Ricky Nave

In college, Ricky studied physics & math, won a prestigious research competition hosted by Oak Ridge National Laboratory, started several small businesses including an energy chewing gum business and a computer repair business, and graduated with a thesis in algebraic topology. After graduating, Ricky attended grad school at Duke University in the mathematics PhD program where he worked on quantum algorithms & non-Euclidean geometry models for flexible proteins. He also worked in cybersecurity at Los Alamos during this time before eventually dropping out of grad school to join a startup working on formal semantic modeling for legal documents. Finally, he left that startup to start his own in the finance & crypto space. Now, he helps entrepreneurs pay less capital gains tax.

Recent Posts