protected static function convertDateTime(DateTime $datetime)
{
static $useFromMutable;
if (null === $useFromMutable) {
$useFromMutable = method_exists(new DateTimeImmutable(), 'createFromMutable');
}
if ($useFromMutable) {
return DateTimeImmutable::createFromMutable($datetime);
}
return new DateTimeImmutable($datetime->format(self::DATE_LOCALE), $datetime->getTimeZone());
}