ZonedDateTime zdt = ZonedDateTime.now(ZoneOffset.UTC);
        int now15Minute = zdt.getMinute() / P15MINUTE * P15MINUTE;
     //instant当前时刻的下一个15分钟时间点 Instant instant
= ZonedDateTime .of(zdt.getYear(), zdt.getMonthValue(), zdt.getDayOfMonth(), zdt.getHour(), now15Minute, 0, 0, ZoneOffset.UTC) .toInstant().plus(Duration.ofMinutes(P15MINUTE));

 

 posted on 2017-01-05 00:17  兰猫-兰兰  阅读(1378)  评论(0编辑  收藏  举报