The DateTimeImmutable class
(PHP 5 >= 5.5.0, PHP 7)
简介
This class behaves the same as DateTime except it never modifies itself but returns a new object instead.
类摘要
DateTimeImmutable
implements DateTimeInterface {
/* 继承的常量 */
/* 方法 */
public
static
createFromFormat (
string
$format
,
string $time
[,
DateTimeZone $timezone
] ) :
DateTimeImmutable
public
setTime (
int
}
$hour
,
int $minute
[,
int $second
= 0 [,
int $microseconds
= 0 ]] ) :
DateTimeImmutable
Table of Contents
- DateTimeImmutable::add — Adds an amount of days, months, years, hours, minutes and seconds
- DateTimeImmutable::__construct — Returns new DateTimeImmutable object
- DateTimeImmutable::createFromFormat — Parses a time string according to a specified format
- DateTimeImmutable::createFromMutable — Returns new DateTimeImmutable object encapsulating the given DateTime object
- DateTimeImmutable::getLastErrors — Returns the warnings and errors
- DateTimeImmutable::modify — Creates a new object with modified timestamp
- DateTimeImmutable::__set_state — The __set_state handler
- DateTimeImmutable::setDate — Sets the date
- DateTimeImmutable::setISODate — Sets the ISO date
- DateTimeImmutable::setTime — Sets the time
- DateTimeImmutable::setTimestamp — Sets the date and time based on a Unix timestamp
- DateTimeImmutable::setTimezone — Sets the time zone
- DateTimeImmutable::sub — Subtracts an amount of days, months, years, hours, minutes and seconds