Skip to content

Commit 50c215c

Browse files
committed
修复 Instant toInstant(date) 可能出现报错的问题
1 parent 5f0a1fe commit 50c215c

5 files changed

Lines changed: 13 additions & 5 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018-2022 Erwin Feng
3+
Copyright (c) 2018-2023 Erwin Feng
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
:bug: Bug
99
```
1010

11+
## v2.2.3
12+
13+
:bug: Bug Fixes
14+
15+
- 修复 `DateTimeUtils.toInstant(Date)` 可能出现报错的问题。
16+
17+
1118
## v2.2.2
1219

1320
2022.11.17 ~

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ JavaLib,是一个Java开发基础工具类库,对项目开发中常用的工
3737
<dependency>
3838
<groupId>com.fengwenyi</groupId>
3939
<artifactId>JavaLib</artifactId>
40-
<version>2.2.2</version>
40+
<version>2.2.3</version>
4141
</dependency>
4242
```
4343

4444
**Gradle**
4545

4646
```groovy
47-
implementation 'com.fengwenyi:JavaLib:2.2.2'
47+
implementation 'com.fengwenyi:JavaLib:2.2.3'
4848
```
4949

5050
## 功能列表:

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.fengwenyi</groupId>
88
<artifactId>JavaLib</artifactId>
9-
<version>2.2.2</version>
9+
<version>2.2.3-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111
<name>JavaLib</name>
1212
<description>JAVA开发常用工具集</description>

src/main/java/com/fengwenyi/javalib/convert/DateTimeUtils.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,8 @@ public static LocalDateTime toLocalDateTime(Instant instant) {
246246
* @return {@link Instant}
247247
*/
248248
public static Instant toInstant(Date date) {
249-
return date.toInstant();
249+
// return date.toInstant();
250+
return Instant.ofEpochMilli(date.getTime());
250251
}
251252

252253
/**

0 commit comments

Comments
 (0)