![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
DateUtil
+ + i
i + +
展开
-
JAVA 给定一个日期,返回今天是周几
JAVA 给定一个日期,返回今天是周几 /** *给定一个日期,返回今天是周几 * @param dt * @return 当前日期是周几 */ public static String getWeekOfDate(Date dt) { String[] weekDays = {"周日", "周一", "周二", "周三", "周四", "周五", "周六"}; Calendar cal = Calendar.getInsta原创 2021-02-26 10:43:18 · 496 阅读 · 0 评论 -
获取前 N天 的日期
获取前 N天 的日期 /** * 获取前 N天 的日期 * @param pastDay 天为单位 * @param newDate 以那个日期为临界点 * @return */ public static Date getPastDate(int pastDay,Date newDate){ Calendar calendar = Calendar.getInstance(); calendar.setTime(n原创 2021-02-26 10:40:19 · 144 阅读 · 0 评论 -
HTML+JS动态获取当前时间
HTML+JS动态获取当前时间转载 2021-02-24 17:31:29 · 417 阅读 · 0 评论 -
java获取过去12个月日期
java获取过去12个月日期 /** * * @return 返回最近12个月的日期 */ public static List<String> getLast12Months(){ ArrayList<String > latest12Months = new ArrayList<>(12); LocalDate today = LocalDate.now(); for(long i原创 2021-02-24 12:55:38 · 806 阅读 · 0 评论 -
java获取指定年月的开始时间与结束时间
java获取指定年月的开始时间与结束时间 public class Test4 { public static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); public static void main(String[] args) { int year = 2021, month = 2; Date beginTime = getBeginTime(year,原创 2021-02-24 12:45:38 · 2267 阅读 · 1 评论