This repository was archived by the owner on Nov 21, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +53
-3
lines changed
src/main/java/org/code4everything/boot/base Expand file tree Collapse file tree 4 files changed +53
-3
lines changed Original file line number Diff line number Diff line change 18
18
<name >boot-surface</name >
19
19
<url >https://github.com/code4everything/boot-surface</url >
20
20
21
+ <!-- 私有仓库发布-->
22
+ <distributionManagement >
23
+ <repository >
24
+ <id >ease-maven</id >
25
+ <url >ftp://maven.code4everything.org/repository</url >
26
+ </repository >
27
+ </distributionManagement >
28
+
21
29
<properties >
22
30
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
23
31
<maven .compiler.source>1.8</maven .compiler.source>
306
314
<version >3.0.0-M1</version >
307
315
</plugin >
308
316
</plugins >
317
+
318
+ <extensions >
319
+ <extension >
320
+ <groupId >org.apache.maven.wagon</groupId >
321
+ <artifactId >wagon-ftp</artifactId >
322
+ <version >1.0-beta-6</version >
323
+ </extension >
324
+ </extensions >
309
325
</build >
310
326
</project >
Original file line number Diff line number Diff line change 2
2
3
3
import cn .hutool .core .date .DateUtil ;
4
4
5
+ import java .time .Instant ;
6
+ import java .time .LocalDate ;
7
+ import java .time .LocalDateTime ;
8
+ import java .time .ZoneId ;
5
9
import java .util .Date ;
6
10
7
11
/**
@@ -54,6 +58,36 @@ public final class DateUtils {
54
58
55
59
private DateUtils () {}
56
60
61
+ /**
62
+ * 日期互转
63
+ *
64
+ * @param localDate {@link LocalDate}
65
+ *
66
+ * @return {@link Date}
67
+ *
68
+ * @since 1.1.6
69
+ */
70
+ public static Date toDate (LocalDate localDate ) {
71
+ ZoneId zone = ZoneId .systemDefault ();
72
+ Instant instant = localDate .atStartOfDay ().atZone (zone ).toInstant ();
73
+ return Date .from (instant );
74
+ }
75
+
76
+ /**
77
+ * 日期互转
78
+ *
79
+ * @param date {@link Date}
80
+ *
81
+ * @return {@link LocalDate}
82
+ *
83
+ * @since 1.1.6
84
+ */
85
+ public static LocalDate toLocalDate (Date date ) {
86
+ Instant instant = date .toInstant ();
87
+ ZoneId zone = ZoneId .systemDefault ();
88
+ return LocalDateTime .ofInstant (instant , zone ).toLocalDate ();
89
+ }
90
+
57
91
/**
58
92
* 获取本年的开始时间点
59
93
*
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public final class IntegerConsts {
42
42
43
43
private IntegerConsts () {}
44
44
45
- public final class FileSize {
45
+ public static final class FileSize {
46
46
47
47
public static final long KB = ONE_THOUSAND_AND_TWENTY_FOUR ;
48
48
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ public final class StringConsts {
22
22
23
23
private StringConsts () {}
24
24
25
- public final class DateFormat {
25
+ public static final class DateFormat {
26
26
27
27
public static final String DATE_TIME_MILLIS = "yyyy-MM-dd HH:mm:ss.SSS" ;
28
28
@@ -39,7 +39,7 @@ public final class DateFormat {
39
39
private DateFormat () {}
40
40
}
41
41
42
- public final class Sign {
42
+ public static final class Sign {
43
43
44
44
public static final String ZERO = "0" ;
45
45
You can’t perform that action at this time.
0 commit comments