# Date and Time

&reftitle.intro;

The `DateTimeImmutable` and related classes allow you represent date/time information. The objects can be created by passing in a string presentation of date/time information, or from the current system's time.

A rich set of methods is supplied to modify and format this information as well, including handling timezones and DST transitions.

The date/time features in PHP implements the ISO 8601 calendar, which is a proleptic Gregorian calendar which implements the current leap-day rules from before the Gregorian calendar was in place, and also includes the year `0` as the year number in between `-1 BCE` and `1 CE`. Leap seconds are not supported.

The date and time information is internally stored as a 64-bit number so all conceivably useful dates (including negative years) are supported. The range is from about 292 billion years in the past to the same in the future.

The timezones referenced in this section can be found in the timezones.

&reference.datetime.setup; &reference.datetime.constants; &reference.datetime.examples; &reference.datetime.datetime; &reference.datetime.datetimeimmutable; &reference.datetime.datetimeinterface; &reference.datetime.datetimezone; &reference.datetime.dateinterval; &reference.datetime.dateperiod; &reference.datetime.reference;

## Date/Time Errors and Exceptions

- DateError (extends Error)

  - DateObjectError

    DateRangeError

- DateException (extends Exception)

  - - DateInvalidOperationException

    - DateInvalidTimezoneException

    - DateMalformedIntervalStringException

    - DateMalformedPeriodStringException

    - DateMalformedStringException

&reference.datetime.formats; &reference.datetime.timezones; &reference.datetime.dateerror; &reference.datetime.dateobjecterror; &reference.datetime.daterangeerror; &reference.datetime.dateexception; &reference.datetime.dateinvalidoperationexception; &reference.datetime.dateinvalidtimezoneexception; &reference.datetime.datemalformedintervalstringexception; &reference.datetime.datemalformedperiodstringexception; &reference.datetime.datemalformedstringexception;