Thread
#multiplatform
    Archie

    Archie

    2 years ago
    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?
    dambakk

    dambakk

    2 years ago
    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)
    Archie

    Archie

    2 years ago
    hm.. how do you do it though? Do you simple use String instead for Dates?
    dambakk

    dambakk

    2 years ago
    No, inside the KMP module I use Klock
    m

    Marc Knaup

    2 years ago
    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
    Archie

    Archie

    2 years ago
    Thanks guys.. gonna check on both of those libraries... ❤️
    russhwolf

    russhwolf

    2 years ago
    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