I am trying to get the total minutes of a Local Time Object in my jtable. As I didnt find any method I tried to convert it to a string and then convert the string to minutes.
The lenght of the nanoseconds is always changing depending of the table inputs and throws then a DateTimeParseException.
How can I convert it without parse Exception ?
Here is the code I use:
String pause = String.valueOf(table.getValueAt(zeile, 4));
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss.SSSSSS");
LocalTime localTime1 = LocalTime.parse(pause, formatter);
Throws the following error:
Exception in thread "AWT-EventQueue-0" java.time.format.DateTimeParseException: Text '00:21:07.480781500' could not be parsed, unparsed text found at index 15