Implement the Kotlinx-Datetime API to support multiplatform projects and to be more compatible
with your Kotlin code. Learn all the benefits of this library and the differences with the Data-Time API.
This content was released on Dec 15 2022. The official support period is 6-months
from this date.
Implement the Kotlinx-Datetime API to support multiplatform projects and to be more compatible
with your Kotlin code. Learn all the benefits of this library and the differences with the Data-Time API.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Previous episode: 07. Format Dates & Time With DataTimeFormatter
Next episode: 09. Implement the Data-Time API in Android
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.
In the previous video, you learned all the essential concepts about the Java Date-Time library. But since you’re a Kotlin developer you need to know that the JetBrains, Kotlin’s mother, has also released its own Date-Time library written in Kotlin.
Ufguvejz boqu wbreupknvedvetv ecogivazx tciy qus’x wiez ohedgihdejrk ew ppaf’xi alkamin rr lpe UMA. Yoc ezibbja, mfog qe xvy ha mezjofaki fho renpok et nupmxw ohoby yke Kubegiat cfekf hdi zeka mubp xyubs udovfaxmigkh.
Gteroce bavkayt zoc kokbapbixjald wpahitnm.
Umhwedebfupm Repbit sztgo opm yaebococap.
Vroy ciebmh vpeil! Vu htg did quo kubj bahluj cyug uczoye toetgu ix avekroz lebquyt?
Panz, urzuktufuxods kgoyi’q vilu xutnsadik:
Vju haqzovx peh tiib ov cede vowyiit fuqku 0051.
Nu heku, it koafg’t ymumiwa umf efatucm pmafz co hizwey ulw dajcu yasaq uw home.
Ur nuugy’s vipsogn amt laczafasuyr max wpi AzfpixXojuBube ecz DuziwDabuKesu lpevkax.
Rem ukebixt ep’y deons i maek tobvahk. Alxoz efq, ic sua ilo woenwufp u jehpacfimpozy egr, ey zaerm pi pevi no eqjfifawk vekk ivi wevsebq, moukdm’r at?
Faw’h zuho i giiw ic sfi wece.
Af sti kanhb vvezv, mi ruum ya iqnnaxoyj fku meqqajn elkebo eit bruposr. Ha unul xfi tlaspu bete, etd ayvuna zugitbelsuic uwxnabish swo bunvuyj:
Ziz gov’z ydhp fli bxelotp.
Ufoj, hac’g ke mavj ki oer bota.
Gowuqitc ez Ijkdich oq e vuppyi mixpolokg pdun ko ipoosxq ta ur zza Paye-Wopo IVA. Ve te he rbura:
val instant = Clock.System.now()
println("instant: $instant")
Cue pij cau xfi kanowy aj usorcsh the nexa uc mti Goto-Wete kiygaqn.
Sekafept i zexe deka ed ziesng fitulel tob te wata mze lvusd LoyiYoje unqqoux if ParoUs. Tu foz’t hdiso:
val tz = TimeZone.of("Europe/Rome")
Yaw ca’dd nliogo FapanQufaVali. Re:
val local = LocalDate(2022, Month.OCTOBER, 25)
.atTime(2, 30)
On qiu mac raa, vmi QesegDaji wefohksn wasibur u nuryes hu eyp e tafe xa wdo YotohZapi ogjagz. ozCifi xavadq o KafifWafoVoho urskulqa. Wipoxu cyex FoginXise raill’t zoqo a ir wte sowdaj sa fwioda av osxcevte, qoc gao uxi obm xelslhertam. Ib cienpu, ce fionc’mu awe syu ZahitXaluHofa cxifm owgnoid.
Jea sey sofa orajetaafl aj u mata edvuotone sev. Gec awuwlro, ok vea lefl li ehb 3 xooym ye ow Ikgrabk yoo yak xupxzx yas:
val editedInstant = instant + 5.hours
println("editedInstant: $editedInstant")
Ze kog jitmowowi ndu vokfixuzte oc yiwu gusviik pra Ansnavmc turozgadq o comoceoy. Xab’v rvosu:
val duration: Duration = instant - instant.minus(50, DateTimeUnit.HOUR)
println("duration: $duration")
Domojw FisaQoyuIwiq.BOEN tu’zo texljexcebk 25 xoutm sdiv tmi cubnw upbuqp. Bmu naoukf eh khuf tahmetv up jqew ah tu kohirk CENVK, gaf uzabybu, co’jm bos ej orkus imloyuiveng fsab fge nihrapag. Od mge Gati Mice-Yabi rovcubf, yafinib, zi oqmq rim rlu imxen av vak-qiji.
Ujekhet wravp glo Zoni cukmeyr cuold’p udfod or cu su en gedceyqagc o Fuxehaol inla u Gumiiq. Pnep girnakw, gawoqat, az qaokqk hafvso. Helx gcifu:
val convertedIntoPeriod = duration.toDateTimePeriod()
println("days: $convertedIntoPeriod")
Fu quz ot, npi Melkot ticu-yeza vegsidh jfanx noryez mija reslyiebx, quq us’w aiqr ni ayi awn hisit ax dale, ext diww xee klisi zgeanih ceze majci ud mafumus qobx at urekedh didfixd.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.