Here you can find the source of formatTime14To12String(String time)
public static String formatTime14To12String(String time)
//package com.java2s; public class Main { public static String formatTime14To12String(String time) { StringBuffer sb = new StringBuffer(); sb.append(time.substring(0, 4) + "-" + time.substring(4, 6)); sb.append("-" + time.substring(6, 8) + " "); sb.append(time.substring(8, 10) + ":" + time.substring(10, 12)); return sb.toString(); }/* w w w.j a v a 2 s. c o m*/ }