Skip to main content

Time APIs

Functions to help convert various time formats to UnixEpoch

timeNow() -> number

Return current time in UnixEpoch seconds

filetimeToUnixEpoch(filetime) -> number

Convert Windows FILETIME to UnixEpoch seconds

ParamTypeDescription
filetimebigintFILETIME timestamp

cocoatimeToUnixEpoch(cocoatime) -> number

Convert macOS Cocoa time to UnixEpoch seconds

ParamTypeDescription
cocoatimenumberCocoa timestamp

hfsToUnixEpoch(hfstime) -> number

Convert macOS HFS+ time to UnixEpoch seconds

ParamTypeDescription
hfstimenumberHFS+ timestamp

oleToUnixEpoch(oletime) -> number

Convert Windows OLE time to UnixEpoch seconds

ParamTypeDescription
oletimenumberOLE timestamp

webkitToUnixEpoch(webkttime) -> number

Convert browser WebKit time to UnixEpoch

ParamTypeDescription
webkittimenumberWebKit timestamp

fatToUnixEpoch(fattime) -> number

Convert Windows FAT time bytes to UnixEpoch

ParamTypeDescription
oletimeUint8ArrayFAT timestamp bytes

unixEpochToISO(timestamp) -> string

Convert timestamp to ISO RFC 3339 string with millisecond precision.
Supports seconds, microseconds, milliseconds, and nanoseconds duration timestamps

ParamTypeDescription
timestampnumber or BigIntUnixEpoch timestamp. Can be seconds, microseconds, milliseconds, or nanoseconds