Instant.ofEpochMilli says this in its javadoc:
* @throws DateTimeException if the instant exceeds the maximum or minimum instant
But that can't actually happen:
$ jshell
| Welcome to JShell -- Version 21
| For an introduction type: /help intro
jshell> import java.time.Instant
jshell> Instant.ofEpochMilli(Long.MAX_VALUE)
$2 ==> +292278994-08-17T07:12:55.807Z
jshell> Instant.ofEpochMilli(Long.MIN_VALUE)
$3 ==> -292275055-05-16T16:47:04.192Z
* @throws DateTimeException if the instant exceeds the maximum or minimum instant
But that can't actually happen:
$ jshell
| Welcome to JShell -- Version 21
| For an introduction type: /help intro
jshell> import java.time.Instant
jshell> Instant.ofEpochMilli(Long.MAX_VALUE)
$2 ==> +292278994-08-17T07:12:55.807Z
jshell> Instant.ofEpochMilli(Long.MIN_VALUE)
$3 ==> -292275055-05-16T16:47:04.192Z
- csr for
-
JDK-8303926 Instant.ofEpochMilli says it can throw an exception that it can't
-
- Closed
-