format
Formats a Calendar into a date-time String.
Since
1.1.1
Return
The formatted date-time string.
See also
Throws
IllegalArgumentException
if the given pattern is invalid
Formats a Date into a date-time String.
Example:
1659814200000.toDate().format("MM/dd/yyyy") // 08/07/2022
Content copied to clipboard
Since
1.1.1
Return
The formatted date-time string.
See also
Throws
IllegalArgumentException
if the given pattern is invalid
Formats a Instant into a date-time String.
Example:
1659814200000.toInstant().format("MM/dd/yyyy") // 08/07/2022
Content copied to clipboard
Since
1.1.1
Return
The formatted date-time string.
See also
Throws
IllegalArgumentException
if the given pattern is invalid
Formats a LocalDate into a date-time String.
Example:
1659814200000.toLocalDate().format("MM/dd/yyyy") // 08/07/2022
Content copied to clipboard
Since
1.1.1
Return
The formatted date-time string.
See also
Throws
IllegalArgumentException
if the given pattern is invalid
Formats a LocalDateTime into a date-time String.
Example:
1659814205950.toLocalDateTime().format("MM/dd/yyyy") // 08/07/2022
Content copied to clipboard
Since
1.1.1
Return
The formatted date-time string.
See also
Throws
IllegalArgumentException
if the given pattern is invalid
Formats a LocalTime into a date-time String.
Example:
val time = LocalTime(11, 10, 0)
time.toLocalDate().format("HH") // 11
Content copied to clipboard
Since
1.1.1
Return
The formatted date-time string.
See also
Throws
IllegalArgumentException
if the given pattern is invalid