Format date properly.