完善了功能
This commit is contained in:
@@ -73,15 +73,15 @@ object DateTimeUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断给定时间是否距离当前时间超过36小时
|
||||
* 判断给定时间是否距离当前时间超过72小时
|
||||
* @param timeInMillis 时间戳(毫秒)
|
||||
* @return true 表示超过36小时,false 表示未超过
|
||||
* @return true 表示超过72小时,false 表示未超过
|
||||
*/
|
||||
fun isMoreThan36HoursFromNow(timeInMillis: Long): Boolean {
|
||||
fun isMoreThanHoursFromNow(timeInMillis: Long): Boolean {
|
||||
val currentTime = System.currentTimeMillis()
|
||||
val timeDifference = currentTime - timeInMillis
|
||||
val hoursDifference = timeDifference / (1000 * 60 * 60) // 毫秒转小时
|
||||
return hoursDifference >= 36
|
||||
return hoursDifference >= 72
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user