Questions tagged [kotlinx-date-time]
5 questions
7
votes
1 answer
How can you format a kotlinx-datetime LocalDateTime?
I'm converting some code from using Java 8's LocalDatetime to using the version from kotlinx-datetime and I can't find any formatting methods. Specifically, I'm replacing a FormatStyle.MEDIUM. Do they not exist and I need to write the…

Sean
- 2,632
- 2
- 27
- 35
2
votes
0 answers
Why does kotlinx-datetime exist? Or: Why are datatime libraries so platform dependant?
I am new to Kotlin native and stumbled upon kotlinx-datetime. Before that i was using jodatime in my android application; More specifically i was using andoid.joda.
I am wondering why these libraries are so platform dependant. What makes impossible…

f.b.
- 490
- 1
- 5
- 17
1
vote
0 answers
How to insert List in room database?
I am using LocalDateTime from kotlinx-datetime library. Want to insert List in Room database. Typeconverter written using Gson library. But following error showing.
java.lang.NullPointerException: Attempt to invoke virtual method…

ChandrimG
- 117
- 2
- 8
1
vote
1 answer
Getting days of current week using kotlinx-datetime KMM
How can I get the dates of the current week using kotlinx.datetime KMM library?
eg. I want to get a list of current week's date like:
("Monday, 07", "Tuesday, 08", "Wednesday, 09", ... )
This is a similar impementation using Calendar:
fun…

Victor Kabata
- 13
- 6
0
votes
0 answers
kmongo connot save kotlinx-datetime objects
I am trying to use kmongo with kotlinx-datetime. The data class looks like this:
@Serializable
data class CustomerCount(
@Contextual val _id: Id?,
val counter: Int,
@Contextual val date: LocalDateTime
) {
…

Roger
- 75
- 7