cyve / time
Time provider
2.0.1
2024-05-17 10:40 UTC
Requires
- php: >=7.4
Requires (Dev)
- phpunit/phpunit: >=6.0
This package is auto-updated.
Last update: 2025-02-17 12:16:59 UTC
README
Time provider
Installation
composer require cyve/time
Usage
$datetime = Time::datetime('2021-01-01', new DateTimeZone('UTC')); // return instance of DateTime $now = Time::now(); $today = Time::today(); $today = Time::tomorrow(); $today = Time::yesterday(); Time::setTimestamp(946684800); echo Time::now()->format('Y-m-d H:i:s'); // 2000-01-01 00:00:00 echo Time::now(new \DateTimeZone('Europe/Paris'))->format('Y-m-d H:i:s'); // 2000-01-01 01:00:00