Hi, may I ask how I should deal with Date Serializ...
# multiplatform
a
Hi, may I ask how I should deal with Date Serialization in Ktor? Is there an equivalent "LocalDate" or "LocalDateTime" in KMP? If not, how do you guys deal with date?
d
I am also interested in this question. Currently we expose the timestamp as long and let the clients convert it to platform specific date types
Oh, wait, you asked about Date serialization 😓 I have no input on that, other than that there exists no Date class in KMP - yet (it is in progress)
a
hm.. how do you do it though? Do you simple use String instead for Dates?
d
No, inside the KMP module I use Klock
😮 1
m
I’ve started working on https://github.com/fluidsonic/fluid-time It only has a subset of
java.time
functionality, is mostly a wrapper, needs some API cleanup and supports only Java and iOS so far. Contributions welcome 😄 Example: https://github.com/fluidsonic/fluid-time/blob/master/sources/common/LocalDateTime.kt
😮 1
a
Thanks guys.. gonna check on both of those libraries... ❤️
r
Or you could just use strings (ISO-8601 format is probably best) in your shared code and translate them via platform-specific APIs at the UI layer