Wrangling Dates & Time in Android

Dec 15 2022 · Kotlin 1.6.21, Android 13, IntelliJ 2022.1

Part 1: Wrangling Dates & Time in Android

05. Localize With ZonedDateTime

Episode complete

Play next episode

About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 04. Store Dates & Times Using Date Classes Next episode: 06. Choose Between ZonedDateTime & Instant

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

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

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")