public static instance ( DateTimeInterface $dt ) : static | ||
$dt | DateTimeInterface | The datetime instance to convert. |
return | static |
public static function instance(DateTimeInterface $dt)
{
if ($dt instanceof static) {
return clone $dt;
}
return new static($dt->format('Y-m-d H:i:s.u'), $dt->getTimeZone());
}