php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
DateTimeImmutable Class Reference
Inheritance diagram for DateTimeImmutable:
DateTimeInterface

Public Member Functions

 __construct (string $datetime="now", ?DateTimeZone $timezone=null)
 
 __serialize ()
 
 __unserialize (array $data)
 
 __wakeup ()
 
 format (string $format)
 
 getTimezone ()
 
 getOffset ()
 
 getTimestamp ()
 
 getMicrosecond ()
 
 diff (DateTimeInterface $targetObject, bool $absolute=false)
 
 modify (string $modifier)
 
 add (DateInterval $interval)
 
 sub (DateInterval $interval)
 
 setTimezone (DateTimeZone $timezone)
 
 setTime (int $hour, int $minute, int $second=0, int $microsecond=0)
 
 setDate (int $year, int $month, int $day)
 
 setISODate (int $year, int $week, int $dayOfWeek=1)
 
 setTimestamp (int $timestamp)
 
 setMicrosecond (int $microsecond)
 

Static Public Member Functions

static __set_state (array $array)
 
static createFromFormat (string $format, string $datetime, ?DateTimeZone $timezone=null)
 
static createFromTimestamp (int|float $timestamp)
 
static getLastErrors ()
 
static createFromMutable (DateTime $object)
 
static createFromInterface (DateTimeInterface $object)
 

Additional Inherited Members

- Data Fields inherited from DateTimeInterface
const string ATOM = DATE_ATOM
 
const string COOKIE = DATE_COOKIE
 
const string ISO8601 = DATE_ISO8601
 
const string ISO8601_EXPANDED = DATE_ISO8601_EXPANDED
 
const string RFC822 = DATE_RFC822
 
const string RFC850 = DATE_RFC850
 
const string RFC1036 = DATE_RFC1036
 
const string RFC1123 = DATE_RFC1123
 
const string RFC7231 = DATE_RFC7231
 
const string RFC2822 = DATE_RFC2822
 
const string RFC3339 = DATE_RFC3339
 
const string RFC3339_EXTENDED = DATE_RFC3339_EXTENDED
 
const string RSS = DATE_RSS
 
const string W3C = DATE_W3C
 

Detailed Description

Definition at line 461 of file php_date.stub.php.

Constructor & Destructor Documentation

◆ __construct()

DateTimeImmutable::__construct ( string $datetime = "now",
?DateTimeZone $timezone = null )

Definition at line 463 of file php_date.stub.php.

Member Function Documentation

◆ __serialize()

DateTimeImmutable::__serialize ( )

Implements DateTimeInterface.

Definition at line 465 of file php_date.stub.php.

◆ __set_state()

static DateTimeImmutable::__set_state ( array $array)
static

@tentative-return-type

Definition at line 473 of file php_date.stub.php.

◆ __unserialize()

DateTimeImmutable::__unserialize ( array $data)

Implements DateTimeInterface.

Definition at line 467 of file php_date.stub.php.

◆ __wakeup()

DateTimeImmutable::__wakeup ( )

@tentative-return-type

Implements DateTimeInterface.

Definition at line 470 of file php_date.stub.php.

◆ add()

DateTimeImmutable::add ( DateInterval $interval)

@tentative-return-type

Definition at line 530 of file php_date.stub.php.

◆ createFromFormat()

static DateTimeImmutable::createFromFormat ( string $format,
string $datetime,
?DateTimeZone $timezone = null )
static

@tentative-return-type @alias date_create_immutable_from_format

Definition at line 479 of file php_date.stub.php.

◆ createFromInterface()

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

Definition at line 556 of file php_date.stub.php.

◆ createFromMutable()

static DateTimeImmutable::createFromMutable ( DateTime $object)
static

@tentative-return-type

Definition at line 553 of file php_date.stub.php.

◆ createFromTimestamp()

static DateTimeImmutable::createFromTimestamp ( int|float $timestamp)
static

@tentative-return-type

Definition at line 482 of file php_date.stub.php.

◆ diff()

DateTimeImmutable::diff ( DateTimeInterface $targetObject,
bool $absolute = false )

@tentative-return-type @alias date_diff

Implements DateTimeInterface.

Definition at line 524 of file php_date.stub.php.

◆ format()

DateTimeImmutable::format ( string $format)

@tentative-return-type @alias date_format

Implements DateTimeInterface.

Definition at line 495 of file php_date.stub.php.

◆ getLastErrors()

static DateTimeImmutable::getLastErrors ( )
static
Returns
array<string, int|array>|false @tentative-return-type @alias date_get_last_errors

Definition at line 489 of file php_date.stub.php.

◆ getMicrosecond()

DateTimeImmutable::getMicrosecond ( )

@alias DateTime\getMicrosecond

Implements DateTimeInterface.

Definition at line 518 of file php_date.stub.php.

◆ getOffset()

DateTimeImmutable::getOffset ( )

@tentative-return-type @alias date_offset_get

Implements DateTimeInterface.

Definition at line 507 of file php_date.stub.php.

◆ getTimestamp()

DateTimeImmutable::getTimestamp ( )

@tentative-return-type @alias date_timestamp_get

Implements DateTimeInterface.

Definition at line 513 of file php_date.stub.php.

◆ getTimezone()

DateTimeImmutable::getTimezone ( )

@tentative-return-type @alias date_timezone_get

Implements DateTimeInterface.

Definition at line 501 of file php_date.stub.php.

◆ modify()

DateTimeImmutable::modify ( string $modifier)

@tentative-return-type

Definition at line 527 of file php_date.stub.php.

◆ setDate()

DateTimeImmutable::setDate ( int $year,
int $month,
int $day )

@tentative-return-type

Definition at line 542 of file php_date.stub.php.

◆ setISODate()

DateTimeImmutable::setISODate ( int $year,
int $week,
int $dayOfWeek = 1 )

@tentative-return-type

Definition at line 545 of file php_date.stub.php.

◆ setMicrosecond()

DateTimeImmutable::setMicrosecond ( int $microsecond)

Definition at line 550 of file php_date.stub.php.

◆ setTime()

DateTimeImmutable::setTime ( int $hour,
int $minute,
int $second = 0,
int $microsecond = 0 )

@tentative-return-type

Definition at line 539 of file php_date.stub.php.

◆ setTimestamp()

DateTimeImmutable::setTimestamp ( int $timestamp)

@tentative-return-type

Definition at line 548 of file php_date.stub.php.

◆ setTimezone()

DateTimeImmutable::setTimezone ( DateTimeZone $timezone)

@tentative-return-type

Definition at line 536 of file php_date.stub.php.

◆ sub()

DateTimeImmutable::sub ( DateInterval $interval)

@tentative-return-type

Definition at line 533 of file php_date.stub.php.


The documentation for this class was generated from the following file: