fromDefault() public static method

Returns default TimeZone
public static fromDefault ( ) : self
return self
コード例 #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
ファイル: TimeZoneTest.php プロジェクト: cermat/valueobjects
 public function testDefaultTz()
 {
     $timeZone = TimeZone::fromDefault();
     $this->assertEquals(date_default_timezone_get(), \strval($timeZone));
 }