cyve/time

时间提供者

2.0.1 2024-05-17 10:40 UTC

This package is auto-updated.

Last update: 2024-09-17 11:22:19 UTC


README

时间提供者

安装

composer require cyve/time

使用

$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