leafs / date
Leaf PHP date module
Fund package maintenance!
Open Collective
leafsphp
Installs: 14 456
Dependents: 2
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.14
- leafs/alchemy: ^1.0
README
Tick v2
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');
Documentation
Installation
You can easily install Leaf using the Leaf CLI:
leaf install date
Or with Composer:
composer require leafs/date
API
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