This commit is contained in:
YAS\29473
2025-03-19 15:58:15 +08:00
parent 98e654b0fc
commit 2cc26fc624
3 changed files with 13 additions and 3 deletions

View File

@@ -1181,4 +1181,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
}
}
/**
* 获取当前时间的前半年日期
* @return
*/
public static String getHalfYearAgo(String nowStr) {
LocalDate now = LocalDate.parse(nowStr);
LocalDate halfYearAgo = now.minusMonths(6);
return halfYearAgo.toString();
}
}