TimeImmutable
class TimeImmutable extends DateTimeImmutable implements TimeInterface
Extension of the PHP DateTimeImmutable class.
Traits
Methods
Returns a new instance according to the specified date.
Returns a new instance according to the specified UNIX timestamp.
Returns a new instance according to the specified DOS timestamp.
Returns a new instance according to the specified time string.
No description
No description
No description
Returns an array containing the number of days in each month of the year.
Returns a formatted date string according to current locale settings.
Returns a copy of the current instance.
Returns a mutable instance of the current instance.
Details
in TimeTrait at line 30
__construct(string $time = 'now', string|DateTimeZone|null $timeZone = null)
Constructor.
in TimeTrait at line 46
static TimeTrait
now(string|DateTimeZone|null $timeZone = null)
Returns a new instance set to the current time.
in TimeTrait at line 60
static TimeTrait|false
createFromDate(int $year, int|null $month = null, int|null $day = null, string|DateTimeZone|null $timeZone = null)
Returns a new instance according to the specified date.
in TimeTrait at line 78
static TimeTrait|false
createFromTimestamp(int $timestamp, string|DateTimeZone|null $timeZone = null)
Returns a new instance according to the specified UNIX timestamp.
in TimeTrait at line 90
static TimeTrait|false
createFromDOSTimestamp(int $timestamp, string|DateTimeZone|null $timeZone = null)
Returns a new instance according to the specified DOS timestamp.
in TimeTrait at line 112
static TimeTrait|false
createFromFormat(string $format, string $time, string|DateTimeZone|null $timeZone = null)
Returns a new instance according to the specified time string.
at line 22
static|false
setTimezone(DateTimeZone $timeZone)
at line 22
static|false
forward(int $seconds)
at line 22
static|false
rewind(int $seconds)
in TimeTrait at line 174
int
getDOSTimestamp()
Returns the DOS timestamp.
in TimeTrait at line 196
bool
isLeapYear()
Returns TRUE if the year is a leap year and FALSE if not.
in TimeTrait at line 213
array
daysInMonths()
Returns an array containing the number of days in each month of the year.
in TimeTrait at line 237
int
daysInMonth()
Returns the number of days in the current or specified month.
in TimeTrait at line 248
string
formatLocalized(string $format)
Returns a formatted date string according to current locale settings.
at line 29
$this
copy()
Returns a copy of the current instance.
at line 39
Time
getMutable()
Returns a mutable instance of the current instance.