From aa925d851857f50eff0556411366690d9a78a0e5 Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期一, 27 十一月 2023 17:30:26 +0800
Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PlayPai

---
 cloud-server-course/src/main/java/com/dsh/course/util/DateTimeHelper.java |   42 +++++++++++++++++++++++++++++++++++-------
 1 files changed, 35 insertions(+), 7 deletions(-)

diff --git a/cloud-server-course/src/main/java/com/dsh/course/util/DateTimeHelper.java b/cloud-server-course/src/main/java/com/dsh/course/util/DateTimeHelper.java
index 32d87b8..5a0ef4b 100644
--- a/cloud-server-course/src/main/java/com/dsh/course/util/DateTimeHelper.java
+++ b/cloud-server-course/src/main/java/com/dsh/course/util/DateTimeHelper.java
@@ -959,6 +959,7 @@
     /**
      * 把给定的时间加上指定的年份,可以为负, 返回新的被加上了年份的日期对象,不影响参数日期对象值
      * Given a certain time and a specified year, which can be negative, returns a new date object with the added year, without affecting the value of the original date object.
+     *
      * @param d
      * @param years
      * @return 日期对象
@@ -977,6 +978,7 @@
     /**
      * 把给定的时间加上指定的月份,可以为负
      * Adding the specified number of month to the given time is possible, including negative values.
+     *
      * @param d
      * @param months
      * @return 日期对象
@@ -994,6 +996,7 @@
     /**
      * 把给定的时间加上指定的天数,可以为负
      * Adding the specified number of day to the given time is possible, including negative values.
+     *
      * @param d    日期对象
      * @param days
      * @return 日期对象
@@ -1011,6 +1014,7 @@
     /**
      * 把给定的时间加上指定的小时,可以为负
      * Adding the specified number of hour to the given time is possible, including negative values.
+     *
      * @param d     日期对象
      * @param hours
      * @return 日期对象
@@ -1028,6 +1032,7 @@
     /**
      * 把给定的时间加上指定的分钟,可以为负
      * Adding the specified number of minute to the given time is possible, including negative values.
+     *
      * @param d
      * @param minutes
      * @return 日期对象
@@ -1045,6 +1050,7 @@
     /**
      * 把给定的时间加上指定的秒数,可以为负
      * Adding the specified number of seconds to the given time is possible, including negative values.
+     *
      * @param d
      * @param seconds
      * @return 日期对象
@@ -1062,6 +1068,7 @@
     /**
      * 把给定的时间加上指定的毫秒数,可以为负
      * Adding the specified number of milliseconds to the given time can result in a negative value.
+     *
      * @param d
      * @param milliseconds
      * @return 日期对象
@@ -1079,6 +1086,7 @@
     /**
      * 设置一个日期对象的年份是新的给定的年份
      * Setting the year of a date object to a new given year.
+     *
      * @param d    需要设定的日期对象
      * @param year 新的年份
      * @return 日期对象
@@ -1096,6 +1104,7 @@
     /**
      * 设置一个日期对象的月份是新的给定的月份
      * Set the month of a date object to a new given month.
+     *
      * @param d     需要设定的日期对象
      * @param month 新的月份
      * @return 新日期对象
@@ -1113,6 +1122,7 @@
     /**
      * 设置一个日期对象的天是新的给定的天
      * Set the day of a date object to a new given day.
+     *
      * @param d   需要设定的日期对象
      * @param day 新的天
      * @return 新日期对象
@@ -1130,6 +1140,7 @@
     /**
      * 设置一个日期对象的小时是新的给定的小时
      * Setting the hour of a date object to a new given hour.
+     *
      * @param d    需要设定的日期对象
      * @param hour 新的小时数
      * @return 新日期对象
@@ -1147,6 +1158,7 @@
     /**
      * 设置一个日期对象的分钟是新的给定的分钟数
      * Set the minutes of a date object to a new given minute value.
+     *
      * @param d      需要设定的日期对象
      * @param minute 新的分钟数
      * @return 新日期对象
@@ -1182,6 +1194,7 @@
     /**
      * 设置一个日期对象的毫秒数是新的给定的分钟数
      * Setting the milliseconds of a date object to a new given minute value.
+     *
      * @param d           需要设定的日期对象
      * @param millisecond 新的毫秒数
      * @return 新日期对象
@@ -1200,6 +1213,7 @@
     /**
      * 返回指定日期的月份的天数量
      * Retrieve the number of days in the month of the specified date.
+     *
      * @param d 日期对象
      */
     public static int getDaysOfMonth(Date d) {
@@ -1211,6 +1225,7 @@
     /**
      * 返回指定日期的月份的天数量
      * Retrieve the number of days in the month of the specified date.
+     *
      * @param year  年
      * @param month 月
      */
@@ -1307,6 +1322,7 @@
     /**
      * 取得下个月的这天,比如2月1日可取得3月1日,此方法有很大局限性,不能用于月末的天数
      * Obtain the same day of the following month, for example, February 1st can obtain March 1st. This method has significant limitations and cannot be used for the last days of the month.
+     *
      * @param date
      * @return
      */
@@ -1363,6 +1379,7 @@
     /**
      * 根据时间获取和当前时间的差距.
      * Obtain the difference between the current time and the time in question.
+     *
      * @param date - 待比较实际
      * @return 时间差距字符串
      */
@@ -1404,6 +1421,7 @@
     /**
      * 获取当前日期后几天的日期
      * Obtaining the date of the day after several days from the current date.
+     *
      * @param day 天数
      * @return
      */
@@ -1423,6 +1441,7 @@
     /**
      * 获取当前日期是星期几<br>
      * Obtain the day of the week for the current date.
+     *
      * @param dt
      * @return 当前日期是星期几
      */
@@ -1441,6 +1460,7 @@
     /**
      * 获取当前日期是星期几<br>
      * Obtain the day of the week for the current date.
+     *
      * @param dt
      * @return 当前日期是星期几
      */
@@ -1526,6 +1546,7 @@
     /**
      * 根据时间获取和当前时间的差距.
      * Obtain the difference between the current time and the time in question.
+     *
      * @param date - 待比较实际
      * @return 时间差距字符串
      */
@@ -1573,6 +1594,7 @@
     /**
      * 是否是同一天
      * it the same day
+     *
      * @param first
      * @param second
      * @return
@@ -1594,6 +1616,7 @@
     /**
      * 是否超过指定时刻
      * Has the specified time limit been exceeded
+     *
      * @param day  时间
      * @param time 指定时刻
      * @return
@@ -1633,6 +1656,7 @@
     /**
      * 指定一天哪一个小时
      * Specify which hour of a particular day.
+     *
      * @param time
      * @return
      */
@@ -1665,6 +1689,7 @@
     /**
      * 数字换算成中文(周)
      * Conversion of numbers to Chinese (weeks)
+     *
      * @param time
      * @return
      */
@@ -1711,6 +1736,7 @@
     /**
      * 获取两个时间的间隔(秒)
      * Obtain the time difference between two instances (in seconds).
+     *
      * @param d1
      * @param d2
      * @return
@@ -1721,7 +1747,7 @@
 
     /**
      * @param date
-     * @return 获取今天最后的时间 
+     * @return 获取今天最后的时间
      * Obtain the final time of today.
      */
     public static Date getEndDate(Date date) {
@@ -1737,7 +1763,7 @@
     }
 
     /**
-     * 日期天数差 
+     * 日期天数差
      * Days Difference
      */
     public static int daysBetween(Date today, Date endDate) throws ParseException {
@@ -1754,8 +1780,9 @@
     }
 
     /**
-     * 获取到当月所有日期 
+     * 获取到当月所有日期
      * Obtain all dates of the current month
+     *
      * @param date
      * @return
      */
@@ -1773,14 +1800,14 @@
         return list;
     }
 
-    public static Date getTodayTime(){
+    public static Date getTodayTime() {
         // 获取当天的开始时间(0点)
         LocalDate today = LocalDate.now();
         LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN);
         return Date.from(startOfDay.atZone(ZoneId.systemDefault()).toInstant());
     }
 
-    public static Date getWeekOfLastDay(){
+    public static Date getWeekOfLastDay() {
         // 获取本周的最后一天的时间(23点59分59秒)
         LocalDate today = LocalDate.now();
         LocalDate lastDayOfWeek = today.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY));
@@ -1790,11 +1817,12 @@
 
     /**
      * 获取有效期数的结束时间
-     * @param startTime 开始时间
+     *
+     * @param startTime   开始时间
      * @param validPeriod 有效期数
      * @return 结束时间
      */
-    public static Date getExpirationDate(Date startTime, int validPeriod){
+    public static Date getExpirationDate(Date startTime, int validPeriod) {
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(startTime);
         calendar.add(Calendar.DAY_OF_MONTH, validPeriod);

--
Gitblit v1.7.1