Here you can find the source of formatDate(Integer date)
public static String formatDate(Integer date)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatDate(Integer date) { try {//w w w. j av a2 s .co m return (date + "").substring(0, 4) + "-" + (date + "").substring(4, 6) + "-" + (date + "").substring(6, 8); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); return ""; } } }