epoch calculation