日期:2014-05-17 浏览次数:20737 次
Calendar c = Calendar.getInstance(); long l = 1121385600000l; c.setTimeInMillis(l); System.out.println(c.getTime());
------解决方案--------------------
import java.text.SimpleDateFormat; import java.util.Calendar; public class Test11 { /** * @param args */ public static void main(String[] args) { Calendar c = Calendar.getInstance(); long l = 1121385600000l; c.setTimeInMillis(l); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd") ; System.out.println("格式化日期 :" + sdf.format(c.getTime())) ; System.out.println("日期:" + c.getTime().toLocaleString()); } }