Problem Scenario:
-
Airtables datetime_parse function is unable to parse a date from a 1970 serial format.
-
A date column is pasted in your Table in as a serial number (ex UNIX format or 1970 serial format).
(Lets say that column is called "InstrumentDate) -
That date column needs to be in a human readable format.
-
People are constantly updating the Table, thereby preventing conversion/fixing by copying the column from excel to convert and repaste.
Example of Problem:
One date column contains date serial values, ex 1515430171 (ie the 1970 serial format of the date).
The date should instead should be reading something like 2018-01-08 .
Solution:
- Create a new column in your table (I named mine “InstrumentDate_readable”)
- make the column’s field type a formula, and paste the following formula into it:
DATETIME_FORMAT( DATEADD( ‘January 1,\n 1970’ , ( FLOOR( InstrumentDate - 25569 ) * 86400 ) , ‘seconds’) , ‘mm/dd/yyyy’ )
Change the italicized text to the name of the field that you are trying to convert.
Big thanks to SilkFire for posting his answer to similar problem on stackoverflow.com (see Converting Excel Date Serial Number to Date using Javascript)