public function testGetDate() { $date = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3)); $time = new Time(new Hour(20), new Minute(50), new Second(10)); $dateTime = new DateTime($date, $time); $this->assertTrue($date->sameValueAs($dateTime->getDate())); }
public function testToString() { $date = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3)); $this->assertEquals('2013-12-3', $date->__toString()); }
/** * Returns current DateTime * * @return DateTime */ public static function now() { $dateTime = new static(Date::now(), Time::now()); return $dateTime; }