Format the date properly