In my app, I have a requirement to format 12 hours time to 24 hours time. What is the method I have to use?
For example, time like 10
Using LocalTime in Java 8, LocalTime has many useful methods like getHour() or the getMinute() method,
For example,
LocalTime intime = LocalTime.parse(inputString, DateTimeFormatter.ofPattern("h:m a"));
String outtime = intime.format(DateTimeFormatter.ISO_LOCAL_TIME);
In some cases, First line alone can do the required parsing