Methods |
public
static
|
immutable(DateTimeInterface|null $datetime = null): DateTimeImmutable
Get a DateTimeImmutable from a DateTimeInterface
Get a DateTimeImmutable from a DateTimeInterface
Parameters
$datetime |
If null , the current time is
used.
|
|
#
|
public
static
|
timezone(DateTimeZone|string|null $timezone = null): DateTimeZone
Get a DateTimeZone from a string or DateTimeZone
Get a DateTimeZone from a string or DateTimeZone
Parameters
$timezone |
If null , the timezone
returned by {@see date_default_timezone_get()} is used.
|
|
#
|
public
static
|
duration(DateInterval|string $interval): int
Get a DateInterval or ISO-8601 duration in seconds
Get a DateInterval or ISO-8601 duration in seconds
|
#
|
public
static
|
maybeSetTimezone(DateTimeInterface $datetime, DateTimeZone|string|null $timezone = null): DateTimeImmutable
Set the timezone of a date and time if not already set
Set the timezone of a date and time if not already set
Parameters
$timezone |
If null , the timezone
returned by {@see date_default_timezone_get()} is used.
|
|
#
|