Plan availability | All plan types |
Permissions |
|
Platform(s) | Web/Browser, Mac app, and Windows app |
This article covers the DATETIME_PARSE() function—taking date & time information and interpreting it as structured values that Airtable can use to streamline your team's and organization's work.
Note
If you are looking to format a date, then you’ll want to utilize the
DATETIME_FORMAT()function. Learn more here and here.
Using the DATETIME_PARSE() function in Airtable
Let’s say you have a single line text field that currently holds the following value: 9/19/2020 2:00pm . Being a text field, this is simply a text string and can't be read by Airtable as a date. This means that it can't be used in the same ways that values in a date field can.
However, DATETIME_PARSE() can read this text string and convert it to a readable date using a formula like this:
DATETIME_PARSE({Text}, 'M/D/YYYY')

That said, Airtable cannot always understand date input formats. If you use a format that DATETIME_PARSE can't translate without some help, you can specify a format to match the format of your date text string so Airtable knows which parts are which.
To start, look at the available format specifiers and create a version of your date text string that's replaced with the appropriate format specifiers. For example, if your data is coming with this format - 4 Mar 2017 23:00 - you would use this specifier: D MMM YYYY HH:mm.
Note
To learn more about supported DATETIME_DIFF() time units and specifiers, check out DATETIME_DIFF unit article.
Using the locale function in Airtable
An optional function that can be used within DATETIME_FORMAT is the SET_LOCALE function. This takes a given date time input and returns that date time formatted to match a particular locale. If you need to parse a date first, then you would use:
DATETIME_PARSE({Text field}, 'M/D/YYYY')
An example formula structure using this function would look like:
DATETIME_FORMAT(SET_LOCALE({Your DATETIME_PARSE formula field}, 'af'), 'LLLL')
Or if you wanted to perform both of these functions within the same formula field, then it would look like this:
DATETIME_FORMAT(SET_LOCALE(DATETIME_PARSE({Text field}, 'M/D/YYYY'), 'af'), 'LLLL')
For more information, and examples, on using SET_LOCALE() please see our support article here.