Browscap\Data\DataCollection::getGenerationDate PHP Method

getGenerationDate() public method

Get the generation DateTime object
public getGenerationDate ( ) : DateTime
return DateTime
    public function getGenerationDate()
    {
        return $this->generationDate;
    }

Usage Example

 /**
  * tests getting the generation date
  *
  * @group data
  * @group sourcetest
  */
 public function testGetGenerationDate()
 {
     // Time isn't always exact, so allow a few seconds grace either way...
     $currentTime = time();
     $minTime = $currentTime - 3;
     $maxTime = $currentTime + 3;
     $testDateTime = $this->object->getGenerationDate();
     self::assertInstanceOf('\\DateTime', $testDateTime);
     $testTime = $testDateTime->getTimestamp();
     self::assertGreaterThanOrEqual($minTime, $testTime);
     self::assertLessThanOrEqual($maxTime, $testTime);
 }
All Usage Examples Of Browscap\Data\DataCollection::getGenerationDate