public function testCanParseDateTime() { // Arrange $value = new DateTime('2000-01-01'); // Act $result = Utils::parseDateTime($value); // Assert $this->assertInstanceOf('DateTime', $result); $this->assertEquals(2000, $result->format('Y')); }
public function setModified($modified) { $this->modified = Utils::parseDateTime($modified); }
/** * Initializes a new instance of this class. * * @param string $type The type to set. * @param string|int|DateTime $date The date to set. */ public function __construct($type, $date) { $this->type = $type; $this->date = Utils::parseDateTime($date); }
public function setEnd($end) { $this->end = Utils::parseDateTime($end); }