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