convertDateTimeObject() public static method

Converts it to the lucene format, including the appropriate TimeZone
public static convertDateTimeObject ( DateTime $dateTime, boolean $includeTimezone = true ) : string
$dateTime DateTime
$includeTimezone boolean
return string
Example #1
0
 public function testConvertDateTimeObjectWithoutTimezone()
 {
     $dateTimeObject = new \DateTime();
     $timestamp = $dateTimeObject->getTimestamp();
     $convertedString = Util::convertDateTimeObject($dateTimeObject, false);
     $date = date('Y-m-d\\TH:i:s\\Z', $timestamp);
     $this->assertEquals($convertedString, $date);
 }