/** * Obtains an instance of {@code LocalTime} from a text string such as {@code 10:15}. * <p> * The string must represent a valid time and is parsed using * {@link java.time.format.DateTimeFormatter#ISO_LOCAL_TIME}. * * @param string $text the text to parse such as "10:15:30", not null * @return LocalTime the parsed local time, not null * @throws DateTimeParseException if the text cannot be parsed */ public static function parse($text) { return self::parseWith($text, DateTimeFormatter::ISO_LOCAL_TIME()); }
public function test_isoLocalTime_basics() { $this->assertEquals(DateTimeFormatter::ISO_LOCAL_TIME()->getChronology(), null); $this->assertEquals(DateTimeFormatter::ISO_LOCAL_TIME()->getZone(), null); $this->assertEquals(DateTimeFormatter::ISO_LOCAL_TIME()->getResolverStyle(), ResolverStyle::STRICT()); }