码迷,mamicode.com
首页 > 其他好文 > 详细

ZoneDateTime 转换Date

时间:2018-01-15 18:42:08      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:first   class   post   tom   row   datetime   smo   当前时间   std   

final ZonedDateTime now = ZonedDateTime.now(); //当前时间
final ZonedDateTime todayZero = now.truncatedTo(ChronoUnit.DAYS); //今天的0点
final ZonedDateTime tomorrowZero = todayZero.plusDays(1); //明天的0点

final ZonedDateTime firstDayOfMonth = todayZero.withDayOfMonth(1); //当月1号0点
final ZonedDateTime nextDayOfMonth = firstDayOfMonth.plusMonths(1);//下月1号0点


final Date from = Date.from(todayZero.toInstant()); //ZoneDateTime 转换成Date

ZoneDateTime 转换Date

标签:first   class   post   tom   row   datetime   smo   当前时间   std   

原文地址:https://www.cnblogs.com/tietazhan/p/8289061.html

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