Formats date objects