fix ydp_to_ymd for d>348