Added an exception handler for bad date formats.