convert date to unix timestamp online code example
Example 1: excel date to unix timestamp
'VBA functions to convert between Excel and Unix date-times.
'These work on Windows and optionally the Mac:
Function UnixDateTime
Dim OSOffset: OSOffset = IIf(Mac, 24107, 25569)
UnixDateTime = (ExcelDateTime - OSOffset) * 86400
End Function
Function ExcelDateTime(UnixDateTime
Dim OSOffset: OSOffset = IIf(Mac, 24107, 25569)
ExcelDateTime = (UnixDateTime / 86400) + OSOffset
End Function
Example 2: convert stripe timestamp to date
let unix_timestamp = 1605404179
var date = new Date(unix_timestamp * 1000);
var hours = date.getHours();
var minutes = "0" + date.getMinutes();
var seconds = "0" + date.getSeconds();
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
console.log(formattedTime);