





















1.根据当前时间往前推N天,且只保留日期,时间置为00:00:00
/**
* 当前时间往前推90天,且只保留日期,时分秒置为00:00:00
*/
public static void test8() {
Date today = new Date();
Date lastDay = DateUtil.offsetDay(today, -90);
Date lastDay2 = DateUtil.beginOfDay(lastDay);
System.out.println(lastDay); //2026-01-24 17:18:36
System.out.println(lastDay2); //2026-01-24 00:00:00
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。