cyve/time

Time provider

2.0 2021-12-09 14:38 UTC

This package is auto-updated.

Last update: 2024-04-09 19:22:02 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