mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8285519: Change usages of TimeUnit.convert to TimeUnit.toXXX
Reviewed-by: rriggs
This commit is contained in:
parent
e7d52e25a2
commit
e833c1d179
4 changed files with 24 additions and 22 deletions
|
@ -97,8 +97,8 @@ class ZipUtils {
|
|||
if (month > 0 && month < 13 && day > 0 && hour < 24 && minute < 60 && second < 60) {
|
||||
try {
|
||||
LocalDateTime ldt = LocalDateTime.of(year, month, day, hour, minute, second);
|
||||
return TimeUnit.MILLISECONDS.convert(ldt.toEpochSecond(
|
||||
ZoneId.systemDefault().getRules().getOffset(ldt)), TimeUnit.SECONDS);
|
||||
return TimeUnit.SECONDS.toMillis(ldt.toEpochSecond(
|
||||
ZoneId.systemDefault().getRules().getOffset(ldt)));
|
||||
} catch (DateTimeException dte) {
|
||||
// ignore
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue