input: 20191024194947087 : length 17 substring: 20191024194947: length 14 output: 2019/04/24 19:49:47 @Test public void dateTimeFormat() { String input = "20191024194947087"; DateTimeFormatter f = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); LocalDateTime ldt = LocalDateTime.parse(input.substring(0, 14), f); String format = ldt.format(DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss")); Assert..