Fixes the case where the DateTime constructor throws an exception.