ugraweb / moment
A simple API for Time, DateTime and DateRange.
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 136
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
pkg:composer/ugraweb/moment
Requires
- php: ^7.0
This package is not auto-updated.
Last update: 2020-08-08 05:19:43 UTC
README
A simple PHP API for Time, DateTime and DateRange.
Installation
The preferred method of installation is via Composer. Run the following command to install the latest version of a package and add it to your project's composer.json
:
composer require arbor-education/moment
Usage
Instantiate Time object
use \Arbor\Moment\Time; $time = Time::fromSeconds(7200); $time = Time::fromString('12:25');
Instantiate DateTime object
use \Arbor\Moment\DateTime; $now = new DateTime(); $today = new DateTime('now', null, DateTime::TYPE_DATE); $past = new DateTime('26 Jul 1984', null, DateTime::TYPE_DATE);
Instantiate DateRange object
use \Arbor\Moment\{DateTime, DateRange}; $range = new DateRange(new DateTime('2016-01-01 00:00:00'), new DateTime('2016-12-31 23:59:59')); $infinityLeft = new DateRange(null, new DateTime()); $infinityRight = new DateRange(new DateTime(), null); $infinity = new DateRange();
Credits
License
Released under MIT License - see the License File for details.