ensure proper date format