computerminds / php-edtf
A library for getting information about EDTF formatted strings.
Installs: 793
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/computerminds/php-edtf
Requires
- guzzlehttp/guzzle: ~6.1|~7.0
Requires (Dev)
- phpunit/phpunit: ~4.0|~5.0
This package is auto-updated.
Last update: 2025-09-29 02:41:59 UTC
README
Usage
Use the factory to get instances of EDTFInfo:
$factory = new \ComputerMinds\EDTF\EDTFInfoFactory();
$dateInfo = $factory->create('1990-01');
Then you can call the various methods on the instance.
$valid = $dateInfo->isValid();
if ($valid) {
$min = $dateInfo->getMin();
$max = $dateInfo->getMax();
// $min and $max are just standard PHP \DateTime instances.
print $min->format('c');
}