Пример #1
0
 /**
  * Returns a DateTimeWithTimeZone object using current DateTime and default TimeZone
  *
  * @return DateTimeWithTimeZone
  */
 public static function now()
 {
     return new static(DateTime::now(), TimeZone::fromDefault());
 }
Пример #2
0
 public function testNow()
 {
     $dateTime = DateTime::now();
     $this->assertEquals(date('Y-n-j G:i:s'), \strval($dateTime));
 }