cyve/time

Time provider

Maintainers

Details

github.com/cyve/time

Source

Issues

Installs: 337

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/cyve/time

2.0.1 2024-05-17 10:40 UTC

This package is auto-updated.

Last update: 2025-09-17 13:40:43 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