Last active
April 5, 2020 19:01
-
-
Save ahallora/730a0fc574591e8199c3bf6aee86d766 to your computer and use it in GitHub Desktop.
Epoch / Unix timestamp to Excel Date converter in JavaScript / ES6 / Node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const timestampToExcelDate = timestamp => { | |
const start = new Date("1899-12-30 00:00:00"); | |
return (timestamp - start) / (1000 * 60 * 60 * 24).toFixed(12); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To convert timestamp to excel date (in Excel) here's the formula:
Explanation: