ClassGo

DateTime

Synopsis

Description

DateTime is a class phpscript declares.

$object = new DateTime($args);

Properties

public object $date_time_immutable

The go field DateTimeImmutable.

Methods

public function add(object $i): DateTime

add adds an interval in place.

The go method Add.

public function diff(mixed $value2, bool ...$args): DateInterval

The go method Diff.

public function format(string $layout): string

format on a DateTime, which mutates in place for the setters below.

The go method Format.

public function get_microsecond(): int

The go method GetMicrosecond.

public function get_offset(): int

The go method GetOffset.

public function get_timestamp(): int

The go method GetTimestamp.

public function get_timezone(): DateTimeZone

The go method GetTimezone.

public function modify(string $spec): DateTime

modify changes this DateTime and returns it.

The go method Modify.

public function set_date(int $y, int $m, int $day): DateTime

set_date on a DateTime changes it in place.

The go method SetDate.

public function set_iso_date(int $year, int $week, int ...$dow): DateTime

set_iso_date on a DateTime changes it in place.

The go method SetISODate.

public function set_microsecond(int $us): DateTime

set_microsecond on a DateTime changes it in place, php 8.4.

The go method SetMicrosecond.

public function set_time(int $h, int $i, int ...$rest): DateTime

set_time on a DateTime changes it in place.

The go method SetTime.

public function set_timestamp(int $ts): DateTime

set_timestamp sets this DateTime to a Unix time and returns it.

The go method SetTimestamp.

public function set_timezone(object $z): DateTime

set_timezone moves this DateTime to a zone and returns it.

The go method SetTimezone.

public function sub(object $i): DateTime

sub subtracts an interval in place.

The go method Sub.

Static methods

Binding

Go type
github.com/titpetric/phpx/stdlib/px/phpx.DateTimegodoc
Package
github.com/titpetric/phpx/stdlib/px/phpxgodoc

See also