PHP code example of cyve / time
1. Go to this page and download the library: Download cyve/time library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cyve / time example snippets
$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