epiphany/date-factory

Simple, mockable, factory for creating dates

v1.1 2021-03-02 15:19 UTC

This package is auto-updated.

Last update: 2024-04-29 03:50:56 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]);