Java tutorial
//package com.java2s; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; public class Main { public static String convertTime(int fetchDate, SimpleDateFormat sdf) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date((long) fetchDate * 1000)); return sdf.format(cal.getTime()); } public static Calendar convertTime(int fetchDate) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date((long) fetchDate * 1000)); return cal; } }