Playground for new date and time standard library for PHP.
Very much early state!
- Completely remove use of legacy functions / classes
- Timezone DB
- Comparing different objects of the same type
- Different calendar systems
- Maybe a civil calendar automatically switching systems.
- Like switching between Julian and Gregorian at a specific date.
- and much more
- Point in time
- Current time
- Relative times
- Formatting and parsing
- Time ranges
- Time measurement
- Time zone and offset
- Calendar
A class that specifies a current point in time.
It's based on unix timestamp with nanosecond adjustment,
supports the Date and Time interface based on UTC,
but otherwise does not provide any time zone information.
Classes that represent a local date, time or date+time without time zone information.
It does not represent a point in time as the used information might be ambiguous.
- New-Year's-Eve: is at a specific local date+time no matter time zone.
It happens at different instants for different locations on the earth.
->
LocalDateTime - Day of birth: A specific date in your passport but on the edge
you might have a different age on different locations on the earth
->
LocalDate - Midnight: A specific time without any date information,
which also happens on different instants on the earth
->
LocalTime
Represents a specific instant at a specific time zone.
A class that represents a specific time zone via a timezone identifier.
The identifier is one of:
±HH:MM[:SS]UTC/GMT- Regional identifier like
Europe/Berlinfrom timezone DB
A specialized zone representing a fixed time offset only.
It's used in
ZonedDateTime->offsetZone->fixedOffsetZoneInfo->fixedOffsetZoneTransition->offset
A representation of a time zone or offset with information of all zone transitions.
How these zone transitions are stored internally (like via database or rules) is not defined by this class.
A representation of a single zone transition with the exact instant when the transition happened/happens and the zone offset that has been / will be applied.
A relative duration of time with fixed definition and does not need to handle time zone on applying.
A relative time including dates that needs to handle time zone on applying.
An Interval defines a time range of two points-in-time.
Represents a specific predefined unit of a date or time.
For formatting (and parsing) dates and times.
An abstraction of the system wall clock.
Represents the current instant synchronized with external clock.
An abstraction of the system monotonic timer.
By default it's initialized with the wall clock.
Singleton implementation of the gregorian calendar system.
Currently, this is the default calendar system used if not provided.
For time measurement using MonotonicClock
without wall clock initializer by default.
The following interfaces are defined:
Instanted: Something that represents a specific point-in-time via ainstantproperty providing anInstantobject.Date: An object that represents a dateTime: An object that represents a timeZoned: An object that is adjusted by time zoneClock: A clockCalendar: An object that represents a calendar system
[1] PHP Date and Time Related Documentation