The from() method is used to obtain an instance of date from an instant object.
Instant uses a precision of nanoseconds, whereas Date uses a precision of milliseconds. The conversion will truncate any excess precision information as though the amount in nanoseconds was subject to integer division by one million.
Instant can store points on the time-line further in the future and further in the past than Date. In this scenario, this method will throw an exception.
Package: java.util
Java Platform: Java SE 8
Syntax:
from(Instant instant)
Parameters:
Name Description instant the instant to convertReturn Value:
A Date representing the same point on the time-line as the provided instant.
Return Value Type: boolean
Java Code Editor:
Previous:equals Method
Next:getTime Method
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4