ludc
2023-04-07 7df1d61319149a666e8b2801a3c89c1d80900d2e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
package com.vci.ubcs.com.vci.starter.web.util;
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
 
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.vci.ubcs.com.vci.starter.util.VciBaseUtil;
 
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
 
public class VciDateUtil {
    private static final String DEFAULT_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
    public static final String DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
    public static final String DateTimeFormatStr = "yyyyMMddHHmmss";
    public static final String DateTimeMillFormatStr = "yyyyMMddHHmmssSSS";
    public static final String DateTimeMillFormat = "yyyy-MM-dd HH:mm:ss.SSS";
    public static final String DateFormat = "yyyy-MM-dd";
    public static final String TimeFormat = "HH:mm:ss";
 
    private VciDateUtil() {
    }
 
    public static Date str2Date(String str, String format) throws Exception {
        if (null != str && !"".equals(str) && !str.equals("null")) {
            if (null == format || "".equals(format) || format.equals("null")) {
                format = "yyyy-MM-dd HH:mm:ss.SSS";
            }
 
            SimpleDateFormat sdf = new SimpleDateFormat(format);
            Date date = null;
 
            try {
                date = sdf.parse(str);
                return date;
            } catch (ParseException var5) {
                throw new Exception(var5);
            }
        } else {
            return null;
        }
    }
 
    public static Date getCurrentMonday() {
        return getCurrentWeekDay(2);
    }
 
    public static Date getCurrentWeekDay(int dayOfWeek) {
        if (dayOfWeek > 7) {
            dayOfWeek = 7;
        }
 
        if (dayOfWeek < 1) {
            dayOfWeek = 1;
        }
 
        Date date = new Date();
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(7, dayOfWeek);
        calendar.set(11, 0);
        calendar.set(12, 0);
        calendar.set(13, 0);
        calendar.set(14, 0);
        return calendar.getTime();
    }
 
    public static Date getCurrentFriday() {
        return getCurrentWeekDay(6);
    }
 
    public static String date2Str(Date date, String format) {
        if (null == date) {
            return null;
        } else {
            if (format == null || format.trim().length() == 0) {
                format = "yyyy-MM-dd HH:mm:ss.SSS";
            }
 
            SimpleDateFormat sdf = new SimpleDateFormat(format);
            return sdf.format(date);
        }
    }
 
    public static String timestamp2Str(Timestamp time) {
        Date date = null;
        if (null == time) {
            return null;
        } else {
            if (null != time) {
                date = new Date(time.getTime());
            }
 
            return date2Str(date, "yyyy-MM-dd HH:mm:ss.SSS");
        }
    }
 
    public static Timestamp str2Timestamp(String str) throws Exception {
        if (str != null && str.trim().length() != 0) {
            Date date = str2Date(str, "yyyy-MM-dd HH:mm:ss.SSS");
            return new Timestamp(date.getTime());
        } else {
            return null;
        }
    }
 
    public static String compareDate(String date, String date1) throws Exception {
        if (date != null && date.trim().length() != 0 && date1 != null && date1.trim().length() != 0) {
            try {
                long time = str2Date(date, "yyyy-MM-dd").getTime();
                long time1 = str2Date(date1, "yyyy-MM-dd").getTime();
                if (time == time1) {
                    return "=";
                } else if (time < time1) {
                    return "<";
                } else {
                    return time > time1 ? ">" : "";
                }
            } catch (Exception var6) {
                throw var6;
            }
        } else {
            throw new Exception("传入compareDate的参数为空");
        }
    }
 
    public static String compareDate(Date date, Date date1) {
        if (date != null && date1 != null) {
            long time = date.getTime();
            long time1 = date1.getTime();
            if (time == time1) {
                return "=";
            } else if (time < time1) {
                return "<";
            } else {
                return time > time1 ? ">" : "";
            }
        } else {
            return "";
        }
    }
 
    public static String dateTimeAddMinutes(String date, int minute) throws Exception {
        String ret = "";
        if (date == null || date.equals("")) {
            date = date2Str(getNow(), "yyyy-MM-dd HH:mm:ss.SSS");
        }
 
        if (minute == 0) {
            return date;
        } else {
            Date d = str2Date(date, "yyyy-MM-dd HH:mm:ss");
            Calendar cal = Calendar.getInstance();
            cal.setTime(d);
            cal.add(12, minute);
            return date2Str(cal.getTime(), "yyyy-MM-dd HH:mm:ss");
        }
    }
 
    public static Date getDateAddDay(String date, int dayCount) throws Exception {
        if (date != null && !date.equals("") && !date.equals("null")) {
            if (dayCount == 0) {
                return str2Date(date, "yyyy-MM-dd");
            } else {
                Date d = str2Date(date, "yyyy-MM-dd");
                Calendar cal = Calendar.getInstance();
                cal.setTime(d);
                cal.add(5, dayCount);
                return cal.getTime();
            }
        } else {
            return getNow();
        }
    }
 
    public static Date getDateAddDay(Date date, int dayCount) {
        if (dayCount == 0) {
            return date;
        } else {
            Calendar cal = Calendar.getInstance();
            cal.setTime(date);
            cal.add(5, dayCount);
            return cal.getTime();
        }
    }
 
    public static long getDaySub(String beginDateStr, String endDateStr) {
        if (beginDateStr != null && !beginDateStr.trim().equals("") && endDateStr != null && !endDateStr.trim().equals("")) {
            long day = 0L;
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
 
            try {
                Date beginDate = format.parse(beginDateStr);
                Date endDate = format.parse(endDateStr);
                day = (endDate.getTime() - beginDate.getTime()) / 86400000L;
            } catch (ParseException var8) {
                var8.printStackTrace();
            }
 
            return day;
        } else {
            return 0L;
        }
    }
 
    public static long getDaySub(Date date, Date date1) {
        return (date.getTime() - date1.getTime()) / 86400000L;
    }
 
    public static Date addOrSubDate(Date d, int addDayType, int addCount) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(d);
        cal.add(addDayType, addCount);
        return cal.getTime();
    }
 
    public static Date getNow() {
        return new Date();
    }
 
    public static String getNowString() {
        return getNowString("yyyy-MM-dd HH:mm:ss.SSS");
    }
 
    public static String getNowString(String simpleDateFormat) {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat(simpleDateFormat);
        return formatter.format(currentTime);
    }
 
    public static Date getNow(String simpleDateFormat) throws Exception {
        return str2Date(getNowString(simpleDateFormat), simpleDateFormat);
    }
 
    public static String getCountdown(String oldtime, String newTime) {
        if (oldtime != null && !oldtime.trim().equals("") && newTime != null && !newTime.equals("")) {
            try {
                Date date1 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(oldtime);
                Date date2 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(newTime);
                long l = date1.getTime() - date2.getTime() > 0L ? date1.getTime() - date2.getTime() : date2.getTime() - date1.getTime();
                long d = 0L;
                long yushu = l;
                long h = 0L;
                long m = 0L;
                if (l > 86400000L) {
                    yushu = l % 86400000L;
                    d = (l - yushu) / 86400000L;
                }
 
                if (yushu > 3600000L) {
                    h = (yushu - yushu % 3600000L) / 3600000L;
                    yushu %= 3600000L;
                }
 
                if (yushu > 60000L) {
                    m = (yushu - yushu % 60000L) / 60000L;
                }
 
                return date1.getTime() - date2.getTime() < 0L ? "已经超期" + d + "天" + h + "小时" + m + "分" : "还剩下" + d + "天" + h + "小时" + m + "分";
            } catch (Exception var14) {
                return "";
            }
        } else {
            return "";
        }
    }
 
    public static long getDateDiffer(String oldTime, String newTime) {
        if (oldTime != null && !oldTime.trim().equals("") && newTime != null && !newTime.equals("")) {
            try {
                Date date1 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(oldTime);
                Date date2 = (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).parse(newTime);
                return date1.getTime() - date2.getTime();
            } catch (Exception var4) {
                return 0L;
            }
        } else {
            return 0L;
        }
    }
 
    public static int getWeeks(int year) {
        if (year == 0) {
            return year;
        } else {
            //int week = false;
            int days = 365;
            if (year % 400 == 0 || year % 4 == 0 && year % 100 != 0) {
                days = 366;
            }
 
            int week = days / 7;
            return week;
        }
    }
 
    public static int getWeekOnDate(Date date) {
        GregorianCalendar g = new GregorianCalendar();
        g.setTime(date);
        return isSunday(date) ? g.get(3) - 1 : g.get(3);
    }
 
    public static Calendar getCalendarFromWeek(String year, int week) throws Exception {
        Date newDate = str2Date(year + "-01-01", "yyyy-MM-dd");
        Calendar caleNew = Calendar.getInstance();
        caleNew.setTime(newDate);
        caleNew.add(3, week - 1);
        return caleNew;
    }
 
    public static String[] getDaysInWeek(int year, int week) {
        String[] thisWeek = new String[7];
 
        try {
            GregorianCalendar gc = (GregorianCalendar)getCalendarFromWeek(year + "-01-01", week);
 
            for(int i = 0; i < 7; ++i) {
                Calendar myCale = Calendar.getInstance();
                myCale.setTime(gc.getTime());
                myCale.set(5, gc.get(5) - gc.get(7) + i + 2);
                thisWeek[i] = date2Str(myCale.getTime(), "yyyy-MM-dd");
            }
        } catch (Exception var6) {
            System.out.println(var6.getMessage());
        }
 
        return thisWeek;
    }
 
    public static boolean isSunday() {
        return isSunday(new Date());
    }
 
    public static boolean isSunday(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        int week = calendar.get(7) - 1;
        return week == 0;
    }
 
    public static boolean isWeekend(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        int week = calendar.get(7) - 1;
        return week == 0 || week == 1;
    }
 
    public static boolean isFriday(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        int week = calendar.get(7) - 1;
        return week == 5;
    }
 
    public static boolean isMouthEnd(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        int dayOfMonth = calendar.get(5);
        int endMonth = calendar.getActualMaximum(5);
        return endMonth == dayOfMonth;
    }
 
    public static boolean isSeasonEnd(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        int y = calendar.get(2) + 1;
        int d = calendar.get(5);
        if (y == 3 && d == 31) {
            return true;
        } else if (y == 6 && d == 30) {
            return true;
        } else if (y == 9 && d == 30) {
            return true;
        } else {
            return y == 12 && d == 31;
        }
    }
 
    public static boolean isYearEnd(Date date) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        int y = calendar.get(2) + 1;
        int d = calendar.get(5);
        return y == 12 && d == 31;
    }
 
    public static Long getProcessedTime(Date newDate, Date startDate) {
        try {
            Long p = newDate.getTime() - startDate.getTime();
            return p;
        } catch (Exception var3) {
            return 0L;
        }
    }
 
    public static String getProcessedTime(Date startDate) {
        return getProcessedTime(new Date(), startDate) + "ms";
    }
 
    public static String getCurrentYear() {
        Calendar c = Calendar.getInstance();
        return String.valueOf(c.get(1) + 1900);
    }
 
    public static String getCurrentYearStart() {
        return getCurrentYear() + "-01-01 00:00:00";
    }
 
    public static String getCurrentYearEnd() {
        return getCurrentYear() + "-12-31 23:59:59";
    }
 
    public static String getCurrentQuarter() {
        String currentMouth = getCurrentMouth();
        int currentMouthInt = getInt(currentMouth);
        if (currentMouthInt > 0 && currentMouthInt <= 3) {
            return "1";
        } else if (currentMouthInt > 3 && currentMouthInt <= 6) {
            return "2";
        } else {
            return currentMouthInt > 6 && currentMouthInt <= 9 ? "3" : "4";
        }
    }
 
    private static int getInt(String s) {
        try {
            return Integer.valueOf(s);
        } catch (Exception var2) {
            return 0;
        }
    }
 
    public static String getCurrentQuarterStart() {
        String currentQuarter = getCurrentQuarter();
        if ("1".equalsIgnoreCase(currentQuarter)) {
            return getCurrentYearStart();
        } else if ("2".equalsIgnoreCase(currentQuarter)) {
            return getCurrentYear() + "-04-01 00:00:00";
        } else {
            return "3".equalsIgnoreCase(currentQuarter) ? getCurrentYear() + "-07-01 00:00:00" : getCurrentYear() + "-10-01 00:00:00";
        }
    }
 
    public static String getCurrentQuarterEnd() {
        String currentQuarter = getCurrentQuarter();
        if ("1".equalsIgnoreCase(currentQuarter)) {
            return getCurrentYear() + "-03-31 23:59:59";
        } else if ("2".equalsIgnoreCase(currentQuarter)) {
            return getCurrentYear() + "-06-30 23:59:59";
        } else {
            return "3".equalsIgnoreCase(currentQuarter) ? getCurrentYear() + "-09-30 23:59:59" : getCurrentYear() + "-12-31 23:59:59";
        }
    }
 
    public static String getCurrentMouth() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(getNow());
        int m = cal.get(2);
        return m < 10 ? "0" + String.valueOf(m) : String.valueOf(m);
    }
 
    public static String getCurrentMouthStart() {
        String currentMouth = getCurrentMouth();
        return getCurrentYear() + "-" + currentMouth + "-01 00:00:00";
    }
 
    public static String getCurrentMouthEnd() {
        String currentMouth = getCurrentMouth();
        int currentMouthInt = getInt(currentMouth);
        if (currentMouthInt != 1 && currentMouthInt != 3 && currentMouthInt != 5 && currentMouthInt != 7 && currentMouthInt != 8 && currentMouthInt != 10 && currentMouthInt != 12) {
            if (currentMouthInt == 2) {
                return isLeapYear(getInt(getCurrentYear())) ? getCurrentYear() + "-" + currentMouth + "-29 23:59:59" : getCurrentYear() + "-" + currentMouth + "-28 23:59:59";
            } else {
                return getCurrentYear() + "-" + currentMouth + "-30 23:59:59";
            }
        } else {
            return getCurrentYear() + "-" + currentMouth + "-31 23:59:59";
        }
    }
 
    public static boolean isLeapYear(int year) {
        return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
    }
 
    public static String getCurrentDay() {
        Calendar cal = Calendar.getInstance();
        cal.setTime(getNow());
        int day = cal.get(5);
        return day < 10 ? "0" + String.valueOf(day) : String.valueOf(day);
    }
 
    public static String getCurrentDayStart() {
        return LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MIN).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
 
    public static String getCurrentDayEnd() {
        return LocalDateTime.of(LocalDateTime.now().toLocalDate(), LocalTime.MAX).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }
 
    public static List<Date> getDateInRange(Date dBegin, Date dEnd) {
        List lDate = new ArrayList();
        lDate.add(dBegin);
        Calendar calBegin = Calendar.getInstance();
        calBegin.setTime(dBegin);
        Calendar calEnd = Calendar.getInstance();
        calEnd.setTime(dEnd);
 
        while(dEnd.after(calBegin.getTime())) {
            calBegin.add(5, 1);
            lDate.add(calBegin.getTime());
        }
 
        return lDate;
    }
 
    public static Date getDateFromStringForVci(String value) {
        Date d = null;
        if (StringUtils.isNotBlank(value)) {
            try {
                if (value.indexOf("-") > -1 && value.indexOf(".") > -1 && value.indexOf(" ") > -1 && value.substring(value.lastIndexOf(".") + 1).length() >= 9) {
                    String ymd = value.substring(0, value.indexOf("."));
                    value = value.substring(value.indexOf(".") + 1);
                    if (value.indexOf(".") > -1) {
                        String hms = value.substring(0, value.lastIndexOf("."));
                        String nano = value.substring(value.lastIndexOf(".") + 1).trim();
                        if (nano.length() > 3) {
                            nano = nano.substring(0, 3);
                        }
 
                        hms = hms.replace(".", ":").replace(" ", "");
                        Date tempDate = str2Date(ymd + " " + hms, "yyyy-M-d h:m:s");
                        if (tempDate != null) {
                            d = str2Date(date2Str(tempDate, "yyyy-MM-dd HH:mm:ss") + "." + nano, "yyyy-MM-dd HH:mm:ss.SSS");
                        }
                    }
                } else if (VciBaseUtil.isNumber(value)) {
                    d = new Date();
 
                    try {
                        d = str2Date(value, "yyyyMMddHHmmssSSS");
                    } catch (Exception var8) {
                        if (value.length() != 14) {
                            d.setTime(VciBaseUtil.getLong(value));
                        } else {
                            try {
                                d = str2Date(value, "yyyyMMddHHmmss");
                                Calendar cal = Calendar.getInstance();
                                cal.setTime(d);
                                if (cal.get(1) < 1900) {
                                    d.setTime(VciBaseUtil.getLong(value));
                                }
                            } catch (Exception var7) {
                                d.setTime(VciBaseUtil.getLong(value));
                            }
                        }
                    }
                } else {
                    d = str2Date(value, "yyyy-MM-dd HH:mm:ss.SSS");
                }
            } catch (Exception var9) {
                try {
                    d = str2Date(value, "yyyy-MM-dd HH:mm:ss.SSS");
                } catch (Exception var6) {
                }
            }
        }
 
        return d;
    }
 
    public static Date readText2Date(String text) {
        if (VciBaseUtil.isNullOrNullString(text)) {
            return null;
        } else {
            SimpleDateFormat dateFormat = null;
            int exactDateLength = 0;
            if (text.trim().indexOf("/") > -1 && text.trim().length() == 19) {
                exactDateLength = 19;
                dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
            } else if (text.trim().indexOf("/") > -1 && text.trim().length() == 17) {
                exactDateLength = 17;
                dateFormat = new SimpleDateFormat("yy/MM/dd HH:mm:ss");
            } else if (text.trim().indexOf("/") > -1 && text.trim().length() == 8) {
                exactDateLength = 8;
                dateFormat = new SimpleDateFormat("yy/MM/dd");
            } else if (text.trim().indexOf("-") > -1 && text.trim().length() >= 19) {
                if (text.trim().length() == 19) {
                    exactDateLength = 19;
                    dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
                } else if (text.trim().length() == 23) {
                    exactDateLength = 23;
                    dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
                }
            } else if (text.trim().indexOf("-") > -1 && text.trim().length() == 17) {
                exactDateLength = 17;
                dateFormat = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
            } else if (text.trim().indexOf("-") > -1 && text.trim().length() == 8) {
                exactDateLength = 8;
                dateFormat = new SimpleDateFormat("yy-MM-dd");
            } else {
                exactDateLength = 19;
                dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            }
 
            if (text != null && exactDateLength >= 0 && text.length() != exactDateLength) {
                throw new IllegalArgumentException("不能初始化时间,因为内容不到" + exactDateLength + "长度");
            } else {
                try {
                    return str2Date(date2Str(dateFormat.parse(text), "yyyy-MM-dd HH:mm:ss"), "yyyy-MM-dd HH:mm:ss.SSS");
                } catch (ParseException var4) {
                    throw new IllegalArgumentException("不能格式化日期: " + var4.getMessage(), var4);
                } catch (Exception var5) {
                    throw new IllegalArgumentException("不能格式化日期: " + var5.getMessage(), var5);
                }
            }
        }
    }
 
    public static String getChinaDate(String d) throws Exception {
        Date s = str2Date(d, "yyyy-MM-dd");
        SimpleDateFormat chineseDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
        Calendar today = Calendar.getInstance();
 
        try {
            today.setTime(chineseDateFormat.parse(date2Str(s, "yyyy年MM月dd日")));
        } catch (ParseException var5) {
            throw new Exception(var5);
        }
 
        Lunar lunar = new Lunar(today);
        return lunar.getDate();
    }
}