fromNative() 공개 정적인 메소드

Returns a new Time object from native timezone name
public static fromNative ( ) : self
리턴 self
예제 #1
0
 /**
  * Returns a new DateTime object from native values
  *
  * @param int    $year
  * @param string $month
  * @param int    $day
  * @param int    $hour
  * @param int    $minute
  * @param int    $second
  * @param string $timezone
  *
  * @return DateTimeWithTimeZone
  */
 public static function fromNative()
 {
     $args = func_get_args();
     $datetime = DateTime::fromNative($args[0], $args[1], $args[2], $args[3], $args[4], $args[5]);
     $timezone = TimeZone::fromNative($args[6]);
     return new static($datetime, $timezone);
 }
예제 #2
0
 public function testFromNative()
 {
     $fromNativeTimeZone = TimeZone::fromNative('Europe/Madrid');
     $constructedTimeZone = new TimeZone(new StringLiteral('Europe/Madrid'));
     $this->assertTrue($fromNativeTimeZone->sameValueAs($constructedTimeZone));
 }