toDate
Since
1.1.0
Convert Long to Date.
Example:
1659873010453L.toDate() // Sun Aug 07 16:20:10 IRDT 2022
Content copied to clipboard
Since
1.1.0
Convert Duration to Date.
Example:
1.days.toDate() // Fri Jan 02 03:30:00 IRST 1970
Content copied to clipboard
Since
1.1.0
Produce a date from the given strings value and pattern.
Example:
"8/7/2022".toDate("MM/dd/yyyy") // Sun Aug 07 00:00:00 IRDT 2022
"Sun Aug 07 16:37:42 IRDT 2022".toDate() // Sun Aug 07 16:37:42 IRDT 2022
"7/2022".toDate("MM/dd/yyyy") // ParseException
Content copied to clipboard
Since
1.1.0
Return
A Date parsed from the string.
See also
Throws
if the beginning of the specified string cannot be parsed.
IllegalArgumentException
if the given pattern is invalid
Convert Instant to Date.
Since
1.1.0
Convert LocalDate to Date.
Since
1.1.0
Convert LocalDateTime to Date.
Since
1.1.0
Convert LocalTime to Date.
Since
1.1.0