public function testToString() { $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->assertEquals('2013-12-3 20:50:10', $dateTime->__toString()); }
public function testGetNumericValue() { $month = Month::APRIL(); $this->assertEquals(4, $month->getNumericValue()); }
public function testToString() { $date = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3)); $this->assertEquals('2013-12-3', $date->__toString()); }
public function testToString() { $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); $timeZone = new TimeZone(new StringLiteral('Europe/Madrid')); $dateTimeWithTz = new DateTimeWithTimeZone($dateTime, $timeZone); $this->assertEquals('2013-12-3 20:50:10 Europe/Madrid', $dateTimeWithTz->__toString()); }
/** * Returns current Date * * @return Date */ public static function now() { $date = new static(Year::now(), Month::now(), MonthDay::now()); return $date; }