Join Slack
Communities
Powered by
Hi, I have a DateTimePeriod from an API, and I wan...
# getting-started
a
Ayfri
01/16/2022, 7:48 PM
Hi, I have a DateTimePeriod from an API, and I want to convert it to
Clock.System.now()
+ the period as an Instant, how do I do this ?
i
ilya.gorbunov
01/16/2022, 8:19 PM
You can use Instant.plus function taking DateTimePeriod and TimeZone:
https://github.com/Kotlin/kotlinx-datetime/blob/v0.3.2/core/common/src/Instant.kt#L180-L187
a
Ayfri
01/16/2022, 11:14 PM
Oh it takes a TimeZone as second argument, this is why I wasn't finding it with just the
+
operator, thanks !
2
Views
Open in Slack
Previous
Next