require('any-date-parser');

function convertDateToEpoch(date) {
    const ndate = new Date.fromAny(date);
    const epoch = ndate.getTime();
    return epoch/1000;
}

function convertEpochToDate(date) {
    const ndate = new Date(date*1000);
    return ndate;
}

module.exports = {
    convertDateToEpoch,
    convertEpochToDate
};