JAVA把毫秒数转换成日期

JAVA毫秒成日期

 
1456人阅读 评论(1) 收藏 举报
long sd=1345185923140L;
           Date dat=new Date(sd);
		   GregorianCalendar gc = new GregorianCalendar(); 
		   gc.setTime(dat);
		   java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
		   String sb=format.format(gc.getTime());
		   System.out.println(sb);


dat.toString() ); 
原文地址:https://www.cnblogs.com/jeanschen/p/3161121.html