https://kotlinlang.org logo
#kotlinx-datetime
Title
# kotlinx-datetime
b

brabo-hi

12/21/2022, 9:29 PM
Hi there, how to serialize
java.util.Date
d

Dmitry Khalanskiy [JB]

12/28/2022, 10:30 AM
Use the more modern java.time API and its
toString
and
parse
methods. You can convert
Date
to and from
java.time.Instant
. Example: https://play.kotlinlang.org/#eyJ2ZXJzaW9uIjoiMS43LjIxIiwicGxhdGZvcm0iOiJqYXZhIiwiYXJncy[…]VTdHIpXG4gICAgcHJpbnRsbihcIiRkYXRlMSwgJGRhdGUyXCIpXG59In0= Or use the
kotlinx.datetime
library instead of Java's API.
19 Views