ZoneDateTime 转换Date

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
posted @ 2018-01-15 17:34  吐槽村  阅读(10728)  评论(0编辑  收藏  举报