首页 > 其他 > 详细

ZoneDateTime 转换Date

时间:2018-01-15 18:09:39      阅读:1384      评论:0      收藏:0      [点我收藏+]
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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!