convert epoch to datetime object for most of the db functions