0
I am making an application that divided a String to write the same in time format. But if I put 102330 instead of returning me 10:23:30 it brings me 1:02:33 and if I put 112126 it formats correctly to 11:21:26. If anyone can help me, I’d appreciate it.
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);
That’s exactly what it was. I used a Pattern to clear the spaces and it worked normally
– R.Santos