Here you can find the source of toStandardTime(String compactTime)
public static String toStandardTime(String compactTime)
//package com.java2s; public class Main { public static String toStandardTime(String compactTime) { if (compactTime.trim().length() < 14) { return ""; } else {//from ww w . j a v a 2 s. c o m return String.format("%s-%s-%s %s:%s:%s", compactTime.substring(0, 4), compactTime.substring(4, 6), compactTime.substring(6, 8), compactTime.substring(8, 10), compactTime.substring(10, 12), compactTime.substring(12, 14)); } } }