Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 586 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 586 Bytes

php-EDTF

Build Status

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');
}