PHPackages                             psx/datetime - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. psx/datetime

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

psx/datetime
============

PHP port of the Java JSR310 time API

v3.1.0(5mo ago)2241.7k↓30.7%3Apache-2.0PHPPHP &gt;=8.1CI passing

Since Apr 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/apioo/psx-datetime)[ Packagist](https://packagist.org/packages/psx/datetime)[ Docs](https://phpsx.org)[ Fund](https://www.paypal.me/fusioapi)[ GitHub Sponsors](https://github.com/chriskapp)[ RSS](/packages/psx-datetime/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (12)Used By (3)

DateTime
========

[](#datetime)

PHP port of the Java JSR 310 time API. This package provides the following classes:

ClassDescriptionDurationA time-based amount of time, such as '34.5 seconds'LocalDateA date without a time-zone in the ISO-8601 calendar system, such as 2007-12-03LocalDateTimeA date-time without a time-zone in the ISO-8601 calendar system, such as 2007-12-03T10:15:30LocalTimeA time without a time-zone in the ISO-8601 calendar system, such as 10:15:30PeriodA date-based amount of time in the ISO-8601 calendar system, such as '2 years, 3 months and 4 days'DayOfWeekA day-of-week, such as 'Tuesday'MonthA month-of-year, such as 'July'All classes are immutable, this means that every modification to the object returns a new instance containing the modification.

Usage
-----

[](#usage)

The following snippet shows some examples how you can use the API.

```
