xpl / datetime
Enhancements to Date and Time Extension shipped with PHP
Requires
- php: >=7.1.0
Requires (Dev)
- doctrine/dbal: >=2.2
- phpunit/phpunit: ~4.0
Suggests
- doctrine/dbal: Enable the use of DateTimes as doctrine field type.
This package is auto-updated.
Last update: 2024-10-24 12:20:42 UTC
README
XPL DateTime component attempts to improve the Date and Time Extension shipped with PHP. It adds some enhancements while is almost fully compatible with the default extension. It is also more ISO 8601 compilant.
Documentation
The component may be 100% compatible with standard Date and Time Extension classes but the names used are based on ISO 8601.
To replace the original PHP implementation with this component, include the following PHP snippet:
use Xpl\DateTime\DateTime as DateTime; use Xpl\DateTime\DateTimeImmutable as DateTimeImmutable; use Xpl\DateTime\DateTimeInterface as DateTimeInterface; use Xpl\DateTime\Duration as DateInterval; use Xpl\DateTime\TimeZone as DateTimeZone;
Just use like the standard PHP extension classes.
Installation
Just use composer to add the dependency:
composer require xpl/datetime:dev-master
Or add the dependecy manually:
-
Update
composer.json
file with the lines:{ "require": { "xpl/datetime": "dev-master" } }
-
And update the dependencies:
composer update xpl/datetime
Authorship
Current maintainer:
- Oscar Cubo Medina. Twitter: @ocubom.
This component starts as an utility class used on an internal project. This is a fork of the idea rewrited from scratch.
Copyright and License
XPL DateTime is licensed under the MIT License – see the LICENSE
file
for details.
If you did not receive a copy of the license, contact with the author.