public class TemporalUtil extends Object
Temporal 工具类封装public static Duration between(Temporal startTimeInclude, Temporal endTimeExclude)
返回结果为Duration对象,通过调用toXXX方法返回相差单位
startTimeInclude - 开始时间(包含)endTimeExclude - 结束时间(不包含)Duration对象public static long between(Temporal startTimeInclude, Temporal endTimeExclude, ChronoUnit unit)
返回结果为时间差的long值
startTimeInclude - 开始时间(包括)endTimeExclude - 结束时间(不包括)unit - 时间差单位Copyright © 2021. All rights reserved.