PHP code example of chrisharrison / clock

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

    

chrisharrison / clock example snippets


$frozenClock = new \ChrisHarrison\Clock\FrozenClock(new \DateTime('1988-05-01 16:00:00'));
echo $frozenClock->now()->format('Y-m-d H:i:s');
echo $frozenClock->now()->format('Y-m-d H:i:s');
echo $frozenClock->now()->format('Y-m-d H:i:s');

$systemClock = new \ChrisHarrison\Clock\SystemClock;
echo $systemClock->now()->format('Y-m-d H:i:s');
echo $systemClock->now()->format('Y-m-d H:i:s');
echo $systemClock->now()->format('Y-m-d H:i:s');