Here you can find the source of roundUp(ZonedDateTime date)
public static ZonedDateTime roundUp(ZonedDateTime date)
//package com.java2s; //License from project: Open Source License import java.time.ZonedDateTime; import java.time.temporal.ChronoField; public class Main { public static ZonedDateTime roundUp(ZonedDateTime date) { ChronoField field = ChronoField.NANO_OF_DAY; return date.with(field, field.range().getMaximum()); }//from www . ja va 2s .com }