fadoe / date
Library to handle PHP DateTime objects
Installs: 4 139
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
Requires (Dev)
- phpunit/phpunit: ^10.2
README
This library provides some classes for date handling in PHP.
Installation
Use composer
to install this library:
composer.phar require fadoe/date
Usage
Compare
Compare is a class to compare \DateTime
classes. You must create a instance with the \DateTime
to compare
against other \DateTime
classes.
There are several compare methods:
DateRange
This class creates \DateTime
classes between two dates.
DateTimeProvider
A class to give some \DateTime
classes. Usefull for classes that need the current date for calculation. With this
class you have a provider for dates and you can mock this in unit tests.