LocalTime parse(CharSequence text)
gets an instance
of LocalTime from a text string such as 10:15.
The string must represent a valid time and is parsed using DateTimeFormatter.ISO_LOCAL_TIME
.
parse
has the following syntax.
public static LocalTime parse(CharSequence text)
The following example shows how to use parse
.
import java.time.LocalTime; public class Main { public static void main(String[] args) { LocalTime l = LocalTime.parse("12:34"); System.out.println(l); } }
The code above generates the following result.