fadoe/date

Library to handle PHP DateTime objects

3.0.0 2023-07-29 08:00 UTC

This package is auto-updated.

Last update: 2024-11-29 10:57:44 UTC


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.