예제 #1
0
 public function testToString()
 {
     $this->assertSame('America/Los_Angeles', (string) TimeZoneRegion::of('America/Los_Angeles'));
 }
예제 #2
0
 /**
  * @param DateTimeParseResult $result
  *
  * @return TimeZoneRegion
  *
  * @throws DateTimeException      If the region is not valid.
  * @throws DateTimeParseException If required fields are missing from the result.
  */
 public static function from(DateTimeParseResult $result)
 {
     $region = $result->getField(Field\TimeZoneRegion::NAME);
     return TimeZoneRegion::of($region);
 }