PHP code example of innmind / time-continuum

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

    

innmind / time-continuum example snippets


use Innmind\TimeContinuum\{
    Clock,
    PointInTime,
    Format,
};
use Innmind\Immutable\Maybe;

$clock = Clock::live();
$now = $clock->now(); // return an instance of PointInTime
echo $now->toString(); // 2016-10-11T12:17:30.123456+02:00

$epoch = $clock->at(
    '1970-01-01T00:00:00.000000+00:00',
    Format::iso8601(),
); // Maybe<PointInTime>