Format the date correctly.