Using DATETIME_PARSE() formula
  • 06 Jul 2022
  • 1 Minute zum Lesen
  • Dunkel
    Hell
  • pdf

Using DATETIME_PARSE() formula

  • Dunkel
    Hell
  • pdf

The content is currently unavailable in German. You are viewing the default English version.
Article Summary

The DATETIME_PARSE() function works by taking a date & time information - written in virtually any format - and interprets it as a structured value that Airtable can understand.

For example, in a single line text field you might have this value written: 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 any of the ways our actual date field can (like for the calendar view).

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')

360089623194ScreenShot2020-04-02at34254PM.jpg

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.

360091779273Image2020-09-17at112406AM.png

360089624634Image2020-09-17at112454AM.png

Once you've converted your text to a readable date format you can use it anywhere a regular date field can be used.

Using the locale function

An optional function that can be used within DATETIME_PARSE is the SET_LOCALE function. This takes a given datetime input and returns that datetime formatted to match a particular locale. An example formula structure using this function would look like: DATETIME_PARSE({Text}, 'M/D/YYYY',)

DATETIME_FORMAT(SET_LOCALE({Date Field}, 'af'), 'LLLL')
For more information, and examples, on using SET_LOCALE() please see our support article here.


War dieser Artikel hilfreich?