Here you can find the source of convertIntToDatePattern2(int date)
public static String convertIntToDatePattern2(int date)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Calendar; public class Main { public static String convertIntToDatePattern2(int date) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Long x = Long.valueOf(date) * 1000; Calendar c = Calendar.getInstance(); c.setTimeInMillis(x);// w w w. ja v a 2 s .c o m return dateFormat.format(c.getTime()); } }