Skip to end of banner
Go to start of banner

Epoch date functions

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

We've encountered an issue exporting this macro. Please try exporting again later.
Functions for working with epoch dates.
function _dateToEpochGMT(date dateToConvert) {
    date startDate = "1970-01-01";
    startDate = startOfDay(startDate);
    interval span = dateToConvert - startDate;
    return formatNumber(span["TOMILLIS"]/1000, "###");
}

function _epochToDateGMT(number epoch) {
    interval span = trim(epoch) + "s";
    date startDate = "1970-01-01";
    return startDate + span;
}
  • No labels