PHP code example of nathanfeitoza / clock-php5.6

1. Go to this page and download the library: Download nathanfeitoza/clock-php5.6 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/ */

    

nathanfeitoza / clock-php5.6 example snippets




reait\Clock\FrozenClock;
use Kreait\Clock\SystemClock;

$systemClock = new SystemClock(new DateTimeZone('UTC'));
var_dump($systemClock->now());

$frozenClock = new FrozenClock(new DateTimeImmutable('2019-08-20 10:41:53'));
var_dump($systemClock->now());

$frozenClock->setTo(new DateTimeImmutable('2019-08-19 19:19:19'));
var_dump($systemClock->now());