项目初始化

This commit is contained in:
2026-03-27 18:02:57 +08:00
parent 82dfec137a
commit 8792372fe0
3 changed files with 46 additions and 15 deletions

View File

@@ -68,4 +68,9 @@ public class DateUtils {
public static LocalDate dateToLocalDate(Date date) {
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
public static Date getFirstDayOfCurrentYear() {
LocalDate firstDayOfYear = LocalDate.now().withDayOfYear(1);
return Date.from(firstDayOfYear.atStartOfDay(ZoneId.systemDefault()).toInstant());
}
}