/** * Obtains an instance of {@code ZonedDateTime} from a text string such as * {@code 2007-12-03T10:15:30+01:00[Europe/Paris]}. * <p> * The string must represent a valid date-time and is parsed using * {@link java.time.format.DateTimeFormatter#ISO_ZONED_DATE_TIME}. * * @param string $text the text to parse such as "2007-12-03T10:15:30+01:00[Europe/Paris]", not null * @return ZonedDateTime the parsed zoned date-time, not null * @throws DateTimeParseException if the text cannot be parsed */ public static function parse($text) { return self::parseWith($text, DateTimeFormatter::ISO_ZONED_DATE_TIME()); }
public function test_isoZonedDateTime_basics() { $this->assertEquals(DateTimeFormatter::ISO_ZONED_DATE_TIME()->getChronology(), IsoChronology::INSTANCE()); $this->assertEquals(DateTimeFormatter::ISO_ZONED_DATE_TIME()->getZone(), null); $this->assertEquals(DateTimeFormatter::ISO_ZONED_DATE_TIME()->getResolverStyle(), ResolverStyle::STRICT()); }