improve timestamp conversion to epoch