We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 45003ab commit 0d479abCopy full SHA for 0d479ab
1 file changed
src/main/java/org/apache/commons/lang3/time/DateUtils.java
@@ -1648,8 +1648,9 @@ public static LocalDateTime toLocalDateTime(final Date date) {
1648
* @since 3.18
1649
*/
1650
public static LocalDateTime toLocalDateTime(final Date date, final TimeZone tz) {
1651
- final LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(Objects.requireNonNull(date, "date").getTime()),
1652
- Objects.requireNonNull(tz, "tz").toZoneId());
+ Objects.requireNonNull(date, "date");
+ Objects.requireNonNull(tz, "tz");
1653
+ final LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(date.getTime()), tz.toZoneId());
1654
if (date instanceof java.sql.Timestamp) {
1655
return localDateTime.withNano(((Timestamp) date).getNanos());
1656
}
0 commit comments