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

---
 cloud-server-account/src/main/java/com/dsh/account/util/DateTimeHelper.java |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/cloud-server-account/src/main/java/com/dsh/account/util/DateTimeHelper.java b/cloud-server-account/src/main/java/com/dsh/account/util/DateTimeHelper.java
index 03bb3d3..e21be63 100644
--- a/cloud-server-account/src/main/java/com/dsh/account/util/DateTimeHelper.java
+++ b/cloud-server-account/src/main/java/com/dsh/account/util/DateTimeHelper.java
@@ -242,7 +242,6 @@
         try {
             return parseToDate(formatDateTimetoString(getSystemDate(), fmtstr));
         } catch (Exception e) {
-            // TODO Auto-generated catch block
             e.printStackTrace();
             return getSystemDate();
         }
@@ -1484,6 +1483,23 @@
     }
 
     /**
+     * 获取当前日期是星期几<br>
+     * Obtain the day of the week for the current date.
+     * @param dt
+     * @return 当前日期是星期几
+     */
+    public static int getWeekNumOfDate(Date dt) {
+        Integer[] weekDays = {7, 1, 2, 3, 4, 5, 6}; // 将周一的数值设为2,依次递增表示周二到周日
+        Calendar cal = Calendar.getInstance();
+        cal.setTime(dt);
+        int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
+        if (w < 0) {
+            w = 6; // 如果为负数,将其设为6,表示周日
+        }
+        return weekDays[w];
+    }
+
+    /**
      * 获取今天时间 2017-11-20 00:00:00
      */
     public static Date todayDate() {

--
Gitblit v1.7.1