toLocalDateTime
Convert Calendar to LocalDateTime.
Since
1.1.0
Convert Date to LocalDateTime.
Since
1.1.0
Convert LocalDate to LocalDateTime.
Since
1.1.0
Convert Long to LocalDateTime.
Example:
1659814200000.toLocalDateTime() // 2022-07-07T00:00
Content copied to clipboard
Since
1.1.0
Produce a LocalDateTime from the given strings value and pattern.
Example:
"08/07/2022 13".toLocalDateTime("MM/dd/yyyy HH") // 2022-08-07T13:00
"Sun Aug 07 16:37:42 IRDT 2022".toLocalDateTime() // 2022-08-07T16:37:42
"7/2022".toLocalDateTime("MM/dd/yyyy") // ParseException
Content copied to clipboard
Since
1.1.0
Return
A LocalDateTime parsed from the string.
See also
Throws
if the beginning of the specified string cannot be parsed.
IllegalArgumentException
if the given pattern is invalid