Join Slack
Powered by
What is your usual way to handle "times of day"? A...
# getting-started
h
Hildebrandt Tobias
09/06/2023, 9:43 AM
What is your usual way to handle "times of day"? As in not entire dates just stuff like from 15:00 to 19:00 every day? Especially in terms of saving those settings in DBs or serializing them as JSON.
s
Sam
09/06/2023, 9:44 AM
https://kotlinlang.org/api/kotlinx-datetime/kotlinx-datetime/kotlinx.datetime/-local-time/
Sam
09/06/2023, 9:45 AM
I would serialise following ISO-8601 rules
h
Hildebrandt Tobias
09/06/2023, 9:46 AM
Ah, man I somehow only found the DateTime variants with whole dates. Weird that those didn't pop up in my searches. Thank you for both.
🍻 1
c
CLOVIS
09/06/2023, 10:19 AM
I recommend reading the
https://github.com/Kotlin/kotlinx-datetime#types
section, it's very clear on the available types and their pro/cons 🙂
h
Hildebrandt Tobias
09/06/2023, 10:35 AM
Thanks!
2
Views
Open in Slack
Previous
Next