All Collections
Tips & Tricks
How to Convert Excel Epoch Time to Dates
How to Convert Excel Epoch Time to Dates

Converting Excel Epoch Time to Dates; including a formula and step-by-step guide for using it in Savant.

Updated over a week ago

It’s sometimes frustrating when you upload an Excel file into a third party tool that enhances your data exploration experience, however, a date field is imported as a number that is most probably found in the forty-thousands.

We’ve come across this frustration multiple times and although Savant has been developed to identify the most appropriate data type to assign to fields uploaded into datasets, Excel still might triumph.

Here is our suggestion - using the below formula, replace the ‘Field’ value with your Excel date field that is input as an Integer or Number.

💡 Hint: Use the TO_NUMBER() or TO_INT functions if your Excel date was input as a String type.

TO_DATE((('Field'-25569)*86400)*1000)

  • TO_DATE - converts your expression to date type

  • 'Field' - your Excel date field

Step-by-step guide to converting Excel Epoch Time to Dates in Savant

  1. Open your dataset in Savant and add a Transform tool after your dataset.

  2. Click on the +Column to open the expression editor.

  3. In the formula editor, enter the following formula, replacing ‘Field’ with the name of your Excel date field:

    TO_DATE((('Field'-25569)*86400)*1000)

  4. Click Confirm to apply the formula to the new field.

  5. The new field will now reveal dates in date type format instead of Epoch Time.

Note that you should use the numbers we suggest in the above formula. They are static across Microsoft Excel and convert Excel time to generic Epoch time which Savant then converts to a date format.

If your Excel date was input as a String type, use the TO_NUMBER() or TO_INT() functions to convert it to a number first.

Alternatively, you may also use the TO_DATETIME() function found in the Savant function suite.

We hope this helps you solve your Excel date woes! If you have any questions or comments, please reach out.

Did this answer your question?