DateTimeImmutable::createFromInterface

PHP 8
DateTimeImmutable::createFromInterface - Returns new DateTimeImmutable object encapsulating the given DateTimeInterface object
Manual
Code Examples

DateTimeImmutable::createFromInterface( DateTimeInterface$object ): public static DateTimeImmutable

Parameters

object

The DateTimeInterface object that needs to be converted to an immutable version. This object is not modified, but instead a new DateTimeImmutable object is created containing the same date, time, and timezone information.

Return Values

Returns a new DateTimeImmutable instance.

Example of DateTimeImmutable::createFromInterface

Show all examples for DateTimeImmutable::createFromInterface

PHP Version:


Function DateTimeImmutable::createFromInterface:

Date and Time Functions

Most used PHP functions