Here you can find the source of formatTime(String time)
public static String formatTime(String time)
//package com.java2s; public class Main { public static String formatTime(String time) { if (time == null || time.trim().length() < 6 || time.trim().equals("000000")) return ""; return time.substring(0, 2) + ":" + time.substring(2, 4) + ":" + time.substring(4, 6); }//w w w. j a v a 2 s .com }