I'd change the logic to this:
```php
$format = DateTime::ISO8601;
if ($dateCreated[19] === '.') {
    $format = 'Y-m-d\TH:i:s.uO';
}
```
This eliminates the `else` condition, which is the default and expected condition.