Interface for formatting differences in text.
An Immutable extension on the native DateTime object.
Adds a number of convenience APIs methods and the ability to easily convert into a mutable object.
An immutable date object.
This class is useful when you want to represent a calendar date and ignore times. This means that timezone changes take no effect as a calendar date exists in all timezones in each respective date.
DatePeriod wrapper that returns Chronos instances.
A wrapper around DateInterval that provides additional convenience methods.
This class uses the decorator pattern to wrap a native DateInterval, providing ISO 8601 duration string formatting and factory methods.
DatePeriod wrapper that returns Chronos instances.
PSR-20 Clock implementation.
Provides a PSR-20 compatible clock that returns Chronos instances. Useful for dependency injection and testing scenarios where you need to control the current time.
Example:
$clock = new ClockFactory('UTC');
$now = $clock->now(); // Returns Chronos instance
Handles formatting differences in text.
Provides a swappable component for other libraries to leverage. when localizing or customizing the difference output.
Basic english only 'translator' for diffForHumans()
Provides string formatting methods for datetime instances.
Expects implementing classes to define static::$toStringFormat