Java获取当前时间后24小时

运用场景:用于定时任务,例如当前时间后多少小时等

时间间隔设置,当前时间后24小时

DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
Calendar calendar = Calendar.
getInstance()
Date date =
new Date()
calendar.setTime(date)

//当前时间循环24小时加下去
Timestamp ts = null
for
(

猜你喜欢

转载自blog.csdn.net/qq_40386113/article/details/108794432
今日推荐