DateTime
class DateTime extends DateTime implements IntegerRepresentation, FloatRepresentation, StringRepresentation, ArrayRepresentation (View source)
the NoreSources\DateTime class extends the built-in
\DateTIme class by adding more capabilities to be constructed ad exported to
various data types.
Constants
| FORMAT_YEAR_LEAP |
Leap year indicator |
| FORMAT_YEAR_ISO8601 |
ISO-8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. |
| FORMAT_YEAR_DIGIT_2 |
A two digit representation of a year |
| FORMAT_YEAR_NUMBER |
A full numeric representation of a year, 4 digits |
| FORMAT_YEAR_DAY_NUMBER |
Day of the year, starting from zero. |
| FORMAT_MONTH_ALPHA_3 |
Abbreviated month name, based on the locale |
| FORMAT_MONTH_NAME |
Full month name, based on the locale |
| FORMAT_MONTH_DIGIT_2 |
Two digit representation of the month |
| FORMAT_MONTH_NUMBER |
Month number without leading zero |
| FORMAT_MONTH_DAY_COUNT |
Number of day in the current month |
| FORMAT_WEEK_DIGIT_2 |
A numeric representation of the week of the year, starting with the first Monday as the first week |
| FORMAT_WEEK_DAY_ISO8601 |
ISO-8601 numeric representation of the day of the week. 1 = Monday 7 = Sunday |
| FORMAT_WEEK_DAY_NUMBER |
Numeric representation of the day of the week. 0 = Sunday 6 = Saturday |
| FORMAT_WEEK_DAY_EN_ALPHA_2 |
English ordinal suffix for the day of the month, 2 character |
| FORMAT_DAY_ALPHA_3 |
A textual representation of a day, three letters |
| FORMAT_DAY_NAME |
A full textual representation of the day |
| FORMAT_DAY_DIGIT_2 |
Two-digit day of the month (with leading zeros) |
| FORMAT_DAY_NUMBER |
Day of the month without leading zeros |
| FORMAT_HOUR_24_DIGIT_2 |
Two digit representation of the hour in 24-hour format |
| FORMAT_HOUR_24_PADDED |
Hour in 24-hour format, with a space preceding single digits |
| FORMAT_HOUR_12_DIGIT_2 |
Two digit representation of the hour in 12-hour format |
| FORMAT_HOUR_12_PADDED |
Hour in 12-hour format, with a space preceding single digits. 1 through 12 |
| FORMAT_SWATCH_TIME |
Swatch internet time 0 to 999 |
| FORMAT_EPOCH_OFFSET |
Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT) |
| FORMAT_HOUR_AM_UPPERCASE |
UPPER-CASE 'AM' or 'PM' based on the given time |
| FORMAT_HOUR_AM_LOWERCASE |
lower-case 'am' or 'pm' based on the given time |
| FORMAT_MINUTE_DIGIT_2 |
Two digit representation of the minute. 00 through 59 |
| FORMAT_SECOND_DIGIT_2 |
Two digit representation of the second. 00 through 59 |
| FORMAT_MILLISECOND |
Millisecondes |
| FORMAT_MICROSECOND |
Microsecondes |
| FORMAT_TIMEZONE_OFFSET |
Timezone offset in seconds |
| FORMAT_TIMEZONE_GMT_OFFSET_COLON |
GMT offset (colon) |
| FORMAT_TIMEZONE_GMT_OFFSET_COLON_Z |
GMT offset (colon) or Z for UTC offset PHP 8+ |
| FORMAT_TIMEZONE_GMT_OFFSET |
GMT offset |
| FORMAT_TIMEZONE_NAME |
Time zone identifier Ex: Europe/Berlin |
| FORMAT_TIMEZONE_DST |
Daylight indicator 0 or 1 |
| FORMAT_TIMEZONE_ALPHA_3 |
The time zone abbreviation |
| FORMAT_TIMESTAMP_ISO8601 |
ISO 8601 date |
| FORMAT_TIMESTAMP_RFC2822 |
RFC 2822 formatted date |
| FORMAT_DESCRIPTION_LABEL |
Timestamp format token label |
| FORMAT_DESCRIPTION_RANGE |
Timestamp format token value range |
| FORMAT_DESCRIPTION_STRFTIME |
Strict equivalent format token for the strftime() function |
| FORMAT_DESCRIPTION_DETAILS |
Timestamp format token additional informations |
Methods
No description
Julian day representation of the given DateTime
Julian day representation of the given DateTime
Full julian day and time representation of the given DateTime
Full julian day and time representation of the given DateTime
Set the date and time from a julian day time
Timestamp data informations
Create a DateTime from a DateTime description array
Indicate if the given array can be used to create a DateTime using DateTime::__set_state() magic method.
No description
No description
Description of PHP date() function tokens
No description
Details
at line 263
__construct(string|integer|float $time = null, DateTimeZone $timezone = null)
at line 282
string
__toString()
at line 299
static integer
toJulianDayNumber(DateTimeInterface $dateTime, boolean $utc = true)
Julian day representation of the given DateTime
at line 331
integer
getJulianDayNumber(boolean $utc = true)
Julian day representation of the given DateTime
at line 349
static number
toJulianDay(DateTimeInterface $dateTime, boolean $utc = true)
Full julian day and time representation of the given DateTime
at line 381
number
getJulianDay()
Full julian day and time representation of the given DateTime
at line 393
setJulianDay(float $jd)
Set the date and time from a julian day time
at line 419
array
getArrayCopy()
Timestamp data informations
at line 472
static DateTime
createFromArray(array $array, boolean $baseClass = true)
Create a DateTime from a DateTime description array
at line 516
static boolean
isDateTimeStateArray(array $array)
Indicate if the given array can be used to create a DateTime using DateTime::__set_state() magic method.
at line 543
integer
getIntegerValue()
at line 552
float
getFloatValue()
at line 592
static mixed|array|ArrayAccess|ContainerInterface|Traversable|array
getFormatTokenDescriptions(string|null $token = null)
Description of PHP date() function tokens