I have an Instant, and I want to format that to a ...
# kotlinx-datetime
r
I have an Instant, and I want to format that to a localized month+year string. So in English, "January 2025", or in Korean "2025년 1월" etc... I know the user's locale, so no magic involved. Feels like this should be very achievable, but can't find any documentation/resources on how to do so in Kotlin multiplatform?
As an aside, this is so hard to search for because "localized date formatting" yields pages and pages of timezone conversion stuff
d
There's no such functionality at the moment, unfortunately: https://github.com/Kotlin/kotlinx-datetime/issues/352
r
Oh bummer. I guess kotlin isn't suitable for localized apps yet?
d
Although there is no built-in functionality in
kotlinx-datetime
, there are solutions written on top of it; for example, please take a look at https://github.com/Kotlin/kotlinx-datetime/discussions/253#discussioncomment-10584159 Whether this counts as "suitable" depends on your point of view.
r
Ah yeah, definitely possible to do this with Java, but not suitable for pure kotlin