Download the PHP package s-mcdonald/chronicle without Composer
On this page you can find all versions of the php package s-mcdonald/chronicle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download s-mcdonald/chronicle
More information about s-mcdonald/chronicle
Files in s-mcdonald/chronicle
Package chronicle
Short Description A Lightweight utility for Dealing with Date and Time in PHP
License MIT
Homepage https://github.com/s-mcdonald/Chronicle
Informations about the package chronicle
Chronicle
Chronicle
is a Date and Time package that provides fluent expression and functionality to manage the
Date and Time in your PHP program.
The Chronicle object has some common useful functions
The Date object represents just the date, no time, so there is no timezone component. You can express your date in fluent/chainable commands, and every value returned is both immutable, and a new object.
Comparing a current month to a prior month can be tricky in some applications.
This is because not every month has the same number of days.
Both Chronicle
and the Date
object have a method
that can handle comparing date easily.
Clock
produces the following output
Time (object)
Chronicle also comes with a Time class. As this is a time class, there is no notion of a date, so like the Date object, there is no need for a timezone. This is purely to assist in displaying and formatting time and converting between object types.
Time object is immutable.
More examples
Most of the Chronicle methods are dealing with the current date or time. So for the values presented, the examples were executed on `12-05-2023``
Documentation
- Installation
- Dependencies
Installation
Via Composer. Run the following command from your project's root.
Dependencies
- Php 8.0
License
Chronicle is licensed under the terms of the MIT License (See LICENSE file for details).