leafs/date

Leaf PHP date module

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

This package is auto-updated.

Last update: 2024-03-31 22:26:19 UTC


README



68747470733a2f2f6c6561667068702e6465762f6c6f676f2d636972636c652e706e67

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');

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