Beispiel #1
0
 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()));
 }
Beispiel #2
0
 public function testToString()
 {
     $date = new Date(new Year(2013), Month::DECEMBER(), new MonthDay(3));
     $this->assertEquals('2013-12-3', $date->__toString());
 }
Beispiel #3
0
 /**
  * Returns current DateTime
  *
  * @return DateTime
  */
 public static function now()
 {
     $dateTime = new static(Date::now(), Time::now());
     return $dateTime;
 }