Java tutorial
//package com.java2s; //License from project: Open Source License import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.TimeZone; public class Main { public static String StampToStringMMddHHmm(long stamp) { Date date = null; Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(stamp); date = calendar.getTime(); // String format = "yyyy-MM-dd HH:mm:ss.SSSZ"; String format = "MM-dd HH:mm"; SimpleDateFormat sdf = new SimpleDateFormat(format); //sdf.setTimeZone(TimeZone.getTimeZone("UTC")); sdf.setTimeZone(TimeZone.getTimeZone("PRC")); return sdf.format(date); } }