updated time conversion to be correct