Package | Description |
---|---|
cn.hutool.core.date |
日期封装,日期的核心为DateTime类,DateUtil提供日期操作的入口
|
Modifier and Type | Method and Description |
---|---|
static DateUnit |
DateUnit.of(ChronoUnit unit)
单位兼容转换,将
ChronoUnit 转换为对应的DateUnit |
static DateUnit |
DateUnit.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DateUnit[] |
DateUnit.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
static long |
DateUtil.between(Date beginDate,
Date endDate,
DateUnit unit)
判断两个日期相差的时长,只保留绝对值
|
static long |
DateUtil.between(Date beginDate,
Date endDate,
DateUnit unit,
boolean isAbs)
判断两个日期相差的时长
|
long |
DateTime.between(Date date,
DateUnit unit)
计算相差时长
|
String |
DateTime.between(Date date,
DateUnit unit,
BetweenFormatter.Level formatLevel)
计算相差时长
|
long |
DateBetween.between(DateUnit unit)
判断两个日期相差的时长
返回 给定单位的时长差 |
long |
GroupTimeInterval.interval(String id,
DateUnit dateUnit)
从开始到当前的间隔时间
|
static ChronoUnit |
DateUnit.toChronoUnit(DateUnit unit)
单位兼容转换,将DateUnit转换为对应的
ChronoUnit |
String |
DateBetween.toString(DateUnit unit,
BetweenFormatter.Level level)
格式化输出时间差
|
Copyright © 2024. All rights reserved.