Format dates properly