https://github.com/navarr/specific-time
An implementation of PSR-20 providing a clock that stands still in time
https://github.com/navarr/specific-time
Last synced: 27 days ago
JSON representation
An implementation of PSR-20 providing a clock that stands still in time
- Host: GitHub
- URL: https://github.com/navarr/specific-time
- Owner: navarr
- License: mit
- Created: 2021-08-28T20:13:42.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-26T18:52:54.000Z (over 2 years ago)
- Last Synced: 2024-12-29T06:22:24.133Z (7 months ago)
- Language: PHP
- Size: 15.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Specific Time (PSR-20)
[](https://packagist.org/packages/navarr/specific-time)
[](https://packagist.org/packages/navarr/specific-time)
[](https://packagist.org/packages/navarr/specific-time)
[](https://packagist.org/packages/navarr/specific-time)


[](https://dashboard.stryker-mutator.io/reports/github.com/navarr/specific-time/main)This is an implementation of PSR-20 that provides a constant time, no matter how many times `->now()` is called on the object.
## Installation
composer require navarr/specific-time:^1
## Usage
```php
use DateTimeImmutable;
use Navarr\SpecificTime\SpecificTime;// ...
$date = new DateTimeImmutable('2021-02-20');
$clock = new SpecificTime($date);// 2021-02-20
echo $clock->now()->format('Y-m-d');
```