xpl/datetime

Enhancements to Date and Time Extension shipped with PHP

1.0.1 2018-09-04 07:52 UTC

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:

  1. Update composer.json file with the lines:

    {
        "require": {
            "xpl/datetime": "dev-master"
        }
    }
    
  2. And update the dependencies:

    composer update xpl/datetime
    

Authorship

Current maintainer:

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.