-
Notifications
You must be signed in to change notification settings - Fork 119
Closed
Labels
formattersRelated to parsing and formattingRelated to parsing and formatting
Milestone
Description
It is not included in the documentation so we would like to ask if Kotlinx Datetime has java.time.format.DateTimeFormatter
equivalent for formatting?
Here are the following usage we had with the Java DateTimeFormatter
val formattedDate: String
get() = LocalDate.parse(date, DateTimeFormatter.ISO_LOCAL_DATE_TIME).format(
DateTimeFormatter.ofPattern("MMM. dd, yyyy")
)
val formattedTime: String = Instant.ofEpochMilli(time).atZone(ZoneId.systemDefault())
.toLocalDate().format(DateTimeFormatter.ofPattern("MM-dd-yyyy"))
LocalDateTime.parse(
lowDate,
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'")
)
Currently using coreLibraryDesugaringEnabled
for backward compatibility.
jeggy, Siddounet, sailor-meow, JellyBrick, aSemy and 6 more
Metadata
Metadata
Assignees
Labels
formattersRelated to parsing and formattingRelated to parsing and formatting