ClassGo
DateTimeImmutable
Synopsis
class DateTimeImmutable {
- public function __construct(mixed ...$args);
- public function add(object $i): DateTimeImmutable;
- public function diff(mixed $other, bool ...$absolute): DateInterval;
- public function format(string $layout): string;
- public function get_microsecond(): int;
- public function get_offset(): int;
- public function get_timestamp(): int;
- public function get_timezone(): DateTimeZone;
- public function modify(string $spec): DateTimeImmutable;
- public function set_date(int $y, int $m, int $day): DateTimeImmutable;
- public function set_iso_date(int $year, int $week, int ...$dow): DateTimeImmutable;
- public function set_microsecond(int $us): DateTimeImmutable;
- public function set_time(int $h, int $i, int ...$rest): DateTimeImmutable;
- public function set_timestamp(int $ts): DateTimeImmutable;
- public function set_timezone(object $z): DateTimeImmutable;
- public function sub(object $i): DateTimeImmutable;
- public static createFromFormat(string, string, mixed ...): mixed;
- public static createFromInterface(mixed): mixed;
- public static createFromMutable(mixed): mixed;
- public static getLastErrors(): mixed;
}
Description
DateTimeImmutable is a class phpscript declares.
$object = new DateTimeImmutable($args);
Methods
public function add(object $i): DateTimeImmutable-
add returns the moment plus an interval.
The go method
Add. public function diff(mixed $other, bool ...$absolute): DateInterval-
diff returns the interval to another moment.
The go method
Diff. public function format(string $layout): string-
format writes the moment as php's date() does.
The go method
Format. public function get_microsecond(): int-
get_microsecond is the microsecond part, php 8.4.
The go method
GetMicrosecond. public function get_offset(): int-
get_offset is the offset from UTC in seconds.
The go method
GetOffset. public function get_timestamp(): int-
get_timestamp is the Unix time in seconds.
The go method
GetTimestamp. public function get_timezone(): DateTimeZone-
get_timezone is the moment's zone.
The go method
GetTimezone. public function modify(string $spec): DateTimeImmutable-
modify applies a relative or absolute change.
The go method
Modify. public function set_date(int $y, int $m, int $day): DateTimeImmutable-
set_date replaces the date.
The go method
SetDate. public function set_iso_date(int $year, int $week, int ...$dow): DateTimeImmutable-
set_iso_date sets the date from an ISO year, week and weekday.
The go method
SetISODate. public function set_microsecond(int $us): DateTimeImmutable-
set_microsecond returns the moment with the microsecond replaced.
The go method
SetMicrosecond. public function set_time(int $h, int $i, int ...$rest): DateTimeImmutable-
set_time replaces the time of day.
The go method
SetTime. public function set_timestamp(int $ts): DateTimeImmutable-
set_timestamp returns the moment at a Unix time.
The go method
SetTimestamp. public function set_timezone(object $z): DateTimeImmutable-
set_timezone moves the moment to a zone, returning a new value.
The go method
SetTimezone. public function sub(object $i): DateTimeImmutable-
sub returns the moment minus an interval.
The go method
Sub.