Skip to content

A VERY simple library of helpers for dealing with EDTF dates

Notifications You must be signed in to change notification settings

computerminds/php-edtf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A VERY simple library of helpers for dealing with EDTF dates

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages