CRUDUI PHP API

Dates
in package

FinalYes

Parse supported date strings for UTC control and list display.

Table of Contents

Constants

MONTHS  : mixed = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul...
ZONES  : mixed = ['z' => 0, 'ut' => 0, 'gmt' => 0, 'est' => -180...

Methods

parseUtc()  : DateTimeImmutable|null
Return UTC at whole-second precision, or null for invalid or unsupported input.
create()  : DateTimeImmutable|null
offset()  : int|null

Constants

MONTHS

private mixed MONTHS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']

ZONES

private mixed ZONES = ['z' => 0, 'ut' => 0, 'gmt' => 0, 'est' => -18000, 'edt' => -14400, 'cst' => -21600, 'cdt' => -18000, 'mst' => -25200, 'mdt' => -21600, 'pst' => -28800, 'pdt' => -25200]

Methods

parseUtc()

Return UTC at whole-second precision, or null for invalid or unsupported input.

public static parseUtc(string $value) : DateTimeImmutable|null
Parameters
$value : string
Return values
DateTimeImmutable|null

create()

private static create(int $year, int $month, int $day, int $hour, int $minute, int $second, int $offset[, string|null $weekday = null ]) : DateTimeImmutable|null
Parameters
$year : int
$month : int
$day : int
$hour : int
$minute : int
$second : int
$offset : int
$weekday : string|null = null
Return values
DateTimeImmutable|null

offset()

private static offset(string $zone) : int|null
Parameters
$zone : string
Return values
int|null
On this page

Search results