convert date values to the right format