/**
- 获取一天的开始时间
*/
fun getStartOfDay(): Date {
val startOfDay = LocalDateTime.of(LocalDate.now(), LocalTime.MIN)
return Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant())
}
/**
- 获取一天的结束时间
*/
fun getEndOfDay(): Date {
val endOfDay = LocalDateTime.of(LocalDate.now(), LocalTime.MAX)
return Date.from(endOfDay.atZone(ZoneId.systemDefault()).toInstant())
}
网友评论