Leaf PHP date module

v2.0 2023-04-02 18:53 UTC

This package is auto-updated.

Last update: 2024-05-01 00:11:45 UTC



Tick v2

Latest Stable Version Total Downloads License

Tick is a minimalist PHP library that parses, validates, manipulates, and displays dates and times with a largely DayJS/MomentJS-compatible API. If you use DayJS, you already know how to use Tick.

tick()->now(); // get the current timestamp
tick()->format('YYYY-MM-DD'); // format the current timestamp
tick()->startOf('month')->add(1, 'day')->set('year', 2018)->format('YYYY-MM-DD HH:mm:ss');



You can easily install Leaf using the Leaf CLI:

leaf install date

Or with Composer:

composer require leafs/date


It's easy to use Tick's APIs to parse, validate, manipulate, and display dates and times.

tick('2018-08-08') // parse
tick()->format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display
tick()->set('month', 3)->month() // get & set
tick()->add(1, 'year') // manipulate
tick()->isBefore('...') // query