Nice solution — but this functionality is built into Airtable.
For 9- or 10-digit timestamps, use this formula:
DATETIME_PARSE(InstrumentDate,'X')
For 12-digit (Unix millesecond timestamps) use
DATETIME_PARSE(InstrumentDate,'x')
Airtable supports an embarrassment of possible date/time formats, but it’s easy to overlook the documentation page.
Nice solution — but this functionality is built into Airtable.
For 9- or 10-digit timestamps, use this formula:
DATETIME_PARSE(InstrumentDate,'X')
For 12-digit (Unix millesecond timestamps) use
DATETIME_PARSE(InstrumentDate,'x')
Airtable supports an embarrassment of possible date/time formats, but it’s easy to overlook the documentation page.
Hello @W_Vann_Hall,
Thank you very much for taking the time to post, and for your willingness to post a native solution! My original post must have been unclear. I have updated it to emphasize and/or add following points:
-
Airtables datetime_parse function is unable to parse a date from a 1970 serial format.
-
1970 format represents the number of miliseconds lapsed since January 0, 1970. It is the way most unix systems (and programs) “see” the current time. For example:
1515430171 is the 1970 serial format for the current date/time (2018-01-08T16:49:31Z).
-
From what I can tell, Airtable’s dateTime_parse function appears to only convert from gregorian formats (what I call humanly readable formats).
Hello @W_Vann_Hall,
Thank you very much for taking the time to post, and for your willingness to post a native solution! My original post must have been unclear. I have updated it to emphasize and/or add following points:
-
Airtables datetime_parse function is unable to parse a date from a 1970 serial format.
-
1970 format represents the number of miliseconds lapsed since January 0, 1970. It is the way most unix systems (and programs) “see” the current time. For example:
1515430171 is the 1970 serial format for the current date/time (2018-01-08T16:49:31Z).
-
From what I can tell, Airtable’s dateTime_parse function appears to only convert from gregorian formats (what I call humanly readable formats).
Please take a look at this demonstration base.
- The left-most column consists of random dates stored in an Airtable Date field.
- The second column is
{Date}
converted to a Unix timestamp using DATETIME_FORMAT()
.
- The third column is the Unix timestamp rendered as a string by copying the values from column 2 and pasting them into a Single-line Text field.
- The right-most column is that textual representation of the Unix timestamp converted into an Airtable Date using
DATETIME_PARSE()
. As you can see, Airtable can convert from the Unix timestamp to its standard Date format natively.
Take a look at the page I linked to in light of the two formulas I provided — I think you’ll find DATETIME_PARSE()
and DATETIME_FORMAT()
to be more capable than you think!
Please take a look at this demonstration base.
- The left-most column consists of random dates stored in an Airtable Date field.
- The second column is
{Date}
converted to a Unix timestamp using DATETIME_FORMAT()
.
- The third column is the Unix timestamp rendered as a string by copying the values from column 2 and pasting them into a Single-line Text field.
- The right-most column is that textual representation of the Unix timestamp converted into an Airtable Date using
DATETIME_PARSE()
. As you can see, Airtable can convert from the Unix timestamp to its standard Date format natively.
Take a look at the page I linked to in light of the two formulas I provided — I think you’ll find DATETIME_PARSE()
and DATETIME_FORMAT()
to be more capable than you think!
Got it! Thanks a million for explaining that in detail!
I presumed your “x” was a representation of “some variable”, but you really meant use “x”
:grinning_face_with_sweat:
thanks for you patience!