Date Format Kotlin

[Solved] Date Format Kotlin | Kotlin - Code Explorer | yomemimo.com
Question : date format kotlin

Answered by : vastemonde

import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
fun main(args: Array<String>) { val current = LocalDateTime.now() val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS") val formatted = current.format(formatter) println("Current Date and Time is: $formatted")
}
// Current Date and Time is: 2021-04-10 10:28:21.052

Source : https://www.datetimeformatter.com/how-to-format-date-time-in-kotlin/ | Last Update : Wed, 28 Apr 21

Answers related to date format kotlin

Code Explorer Popular Question For Kotlin