1. Go to this page and download the library: Download phpsoftbox/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/ */
phpsoftbox / clock example snippets
use PhpSoftBox\Clock\Clock;
$now = Clock::now();
use PhpSoftBox\Clock\Clock;
Clock::freeze(new \DateTimeImmutable('2026-02-27 00:00:00'));
// ... тесты
Clock::reset();
use PhpSoftBox\Clock\Clock;
Clock::freeze(new \DateTimeImmutable('2026-02-27 00:00:00'));
Clock::travel(60); // +60 секунд
Clock::travel('+1 hour'); // или строкой
Clock::reset();
use PhpSoftBox\Clock\DatePoint;
$createdAt = new DatePoint();
use PhpSoftBox\Clock\DatePoint;
$a = DatePoint::fromString('2026-02-27 12:30:00'); // свободный разбор PHP
$b = DatePoint::fromString('27/02/2026 12:30', 'd/m/Y H:i'); // строго по формату
$c = DatePoint::fromString('2026-02-27', '!Y-m-d'); // 2026-02-27 00:00:00
$d = DatePoint::fromString('2026-02-27', 'Y-m-d'); // время берётся из Clock::now()
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.