I'm doing an application that divided a String to write the same in the time format. But if I put 102330 instead of returning me 10:23:30 it brings me 1:02:33 being that if I put 112126 it formats correctly for 11:21:26. If anyone can help me, thank you.
StringBuilder format = new StringBuilder();
format.append(hora.substring(0, 2)).
append(":").append(hora.substring(2, 4)).
append(":").append(hora.substring(4, 6));
System.out.println("Hora: " +format);