PHP code example of rezzza / time-traveler

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

    

rezzza / time-traveler example snippets


\Rezzza\TimeTraveler::enable();
\Rezzza\TimeTraveler::moveTo('2011-06-10 11:00:00');

var_dump(new \DateTime());           // 2011-06-10 11:00:00
var_dump(new \DateTime('+2 hours')); // 2011-06-10 13:00:00
var_dump(time());
var_dump(microtime());
var_dump(microtime(true));

\Rezzza\TimeTraveler::comeBack();