epiphany / date-factory
Simple, mockable, factory for creating dates
v1.1
2021-03-02 15:19 UTC
Requires
- php: ^7.1|^8.0
Requires (Dev)
- phpspec/phpspec: ^6.2
This package is auto-updated.
Last update: 2026-03-01 00:11:54 UTC
README
#Date Factory
A simple, re-usable DateTime factory that can be injected into services and easily mocked.
Usage:
$dateTimeFactory = new DateTimeFactory();
$now = $dateTimeFactory->now();
$then = $dateTimeFactory->now("yesterday"); // accepts any input to \DateTime::__construct()
var_dump([$now,$then]);