码迷,mamicode.com
首页 > Windows程序 > 详细

3、其他类API-----练习1:将毫秒值转成 指定的日期的格式

时间:2018-01-29 17:34:21      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:span   orm   通过   log   new   ring   post   api   xxxx   

将毫秒值转成 指定的日期的格式   xxxx年xx月xx日   hh:mm:ss
                    步骤:
                    //1,毫秒值time--->Date
                    Date date = new Date(time);
                    //2,通过日期时间格式器对象DateFormat对日期对象进行格式化(日期--->文本字符串)
                    DateFormat format = DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.LONG);
                    String str_time = format.format(date);
                    System.out.println(str_time);

 

3、其他类API-----练习1:将毫秒值转成 指定的日期的格式

标签:span   orm   通过   log   new   ring   post   api   xxxx   

原文地址:https://www.cnblogs.com/a888/p/8378169.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!