Here you can find the source of long2Date(Long date, String interval)
public static final String long2Date(Long date, String interval)
//package com.java2s; //License from project: Open Source License public class Main { private StringBuffer sb = null; public static final String long2Date(Long date, String interval) { String line = String.valueOf(date); if (line.length() != 8) { return null; } else {//w w w . j a va 2 s .co m StringBuffer buf = new StringBuffer(10); buf.append(line.substring(0, 4)); buf.append(interval); buf.append(line.subSequence(4, 6)); buf.append(interval); buf.append(line.substring(6, 8)); return buf.toString(); } } public void append(String str) { sb.append(str); } }