toInstant
Convert Long to Instant.
Example:
1659814200000.toInstant() // 2022-08-06T19:30:00Z
Content copied to clipboard
Since
1.1.0
Produce an Instant from the given strings value and pattern.
Example:
"8/7/2022".toInstant("MM/dd/yyyy") // 2022-08-06T19:30:00Z
"Sun Aug 07 16:37:42 IRDT 2022".toInstant() // 2022-08-07T12:07:42Z
"7/2022".toInstant("MM/dd/yyyy") // ParseException
Content copied to clipboard
Since
1.1.0
Return
An Instant parsed from the string.
See also
Throws
if the beginning of the specified string cannot be parsed.
IllegalArgumentException
if the given pattern is invalid