ensure date is formatted