Add ymd->dateformat and add unit tests