Wrangling Dates & Time in Android

Dec 15 2022 Kotlin 1.6.21, Android 13, IntelliJ 2022.1

Part 1: Wrangling Dates & Time in Android

5. Localize With ZonedDateTime

Episode complete

Play next episode

Save for later
About this episode
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 4. Store Dates & Times Using Date Classes Next episode: 6. Choose Between ZonedDateTime & Instant

This video Localize With ZonedDateTime was last updated on Dec 15 2022

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

You can think of ZonedDateTime as an Instant combined with a ZoneId.

val zdt = ZonedDateTime.now()
println("zdt: $zdt")
val amsterdamZone = ZoneId.of("Europe/Amsterdam")
val localizedZdt = ZonedDateTime.now(amsterdamZone)
println("localizedZdt: $localizedZdt")
val doctorAppointment = LocalDateTime.of(2023, Month.OCTOBER, 23, 11, 0)
val doctorCurrentZoned = doctorAppointment.atZone(ZoneId.systemDefault())
println("doctorInstantAppointment: $doctorCurrentZoned")