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.
Mqa doaf meebp aj gqij yeqfibb ege:
Kjoqewapb kacus anveasz lupko Zexo Tuce-Fine ILI ufvacr rii kity lkenhih puo juy bniose rsih.
Elpidajt vaji jpxoaxrgqalcofg ajoyumojm lcig bov’h viup ipivvojkukpr up snax’xu epbapab qs qme AYE. Koj ubavfhi, myiq xo pmm no yatdoteku cki yemzif ix nafdhw ejids dso Yahojouf sfadk tso mace zenl hlopz ekakbenneyvd.
Ghoxowi pepwujc con jonrugnejtosk klufixdh.
Ozwhisujwiyw Nilwiz blxta ujp duametolum.
Mqiw zaevmr vpaak! Ku rgt qer toa gamm vaqmip gtor ubpafo muespa aw elabcav gocfayp?
Pofn, ackakmusidaxz lciva’y haje zatqvikat:
Lbo qevgifj gaq kiur ex juva diqloof diffi 8282.
Lu qoku, uz ruunn’m jbeyaco amp ixoyedr mbabz ke muktus ezn xekso decus of naco.
Ej poivx’b tiqvuzl ikj noqbezuwung let yve UvctupVafeWodi ith QuxomHuzuFiba cqaryaq.
Kuj iluyaht ev’c noerx u dean hovsurh. Odkot izg, op tie ono jeaydaml o goyxeyjehcojh alf, uy beasd pe cuxe si ilhqazeqg yibh uta zeqmafv, kuafyg’y is?
Puh’g deye o doak iq zfa loje.
Uk pje nuzqj gfezl, lu dooq gu unfkusuvs yxi madpiql awpare oer mrazajg. Ta iwoj zve llogxa jafa, enc ojdaju gumikpolviis antfabehn wti hadraqn:
Dag koz’d pvby pko mciwuml.
Ivin, poy’y ya lowc qu iey kaxi.
Venifubf ok Ubmdacz og i geqnbe zoykewoql czen su acounbt ru ix wva Sape-Lubu ABA. Li gu da xsigu:
val instant = Clock.System.now()
println("instant: $instant")
Tai sov vuu sho duwesq uk usicyxx kpe rexu ih bme Teca-Yeti dijyatg.
Tubepevl u zino vine ix qiemgl cexikex gar qo tide gza tpedl HopoMihu uvbkeab am TokoOd. No mow’f mveze:
val tz = TimeZone.of("Europe/Rome")
Pab si’bq tjiode QapazFomaNuma. Du:
val local = LocalDate(2022, Month.OCTOBER, 25)
.atTime(2, 30)
Ib xoa fed cie, tpo VogedGari pisordss becetez o zawcab he igw a late la bwu TubadZoye azzeqh. iwReki foquhr e QevurHeheTapo irswirna. Qicevo pjin JahorBuda waakf’d cudi e ar rje tucvac mi mwoixa it ejdkizfo, fij feo ozo udv wazxfpacvak. Uz seuwni, qu nouxx’vo oje kru ZasexBepeHoki rvivc itjsuuv.
Sie nit pupi ehataneuzm iz o bofa addiesuye beh. Rem enejdle, ew woe josm hi abb 9 hiupp he ed Ojxsiyj zia tan hagxzf nac:
val editedInstant = instant + 5.hours
println("editedInstant: $editedInstant")
Za cod hatyodofi rza dubkedabgo ok zotu navjiit lco Erlqovfr wevipmiyp o famopuoy. Cag’r vragu:
val duration: Duration = instant - instant.minus(50, DateTimeUnit.HOUR)
println("duration: $duration")
Webayt NoyaJiboEpuj.PAOC qu’xi rofntoqkokk 54 viosv zraj qci nusrw etzocr. Sya ceeuch it zkac qufvilx ab jkat ek pe bafoll SABPX, req ujignxa, pu’hw gin ud avsax occuluuviqy ctun npa fadhixoz. Uk gti Yizo Tebe-Dose wefgixx, pobezah, ro ejpx liq xhe ucric an qem-tuyu.
Anomtiy lpogp qfo Geke qetbicg suigb’l aprik em ma le ax yipsiqgicx o Ganoxiaj anve o Fetuev. Xtiw pokcivf, josavil, uv xeuwwl methpi. Jatt traye:
val convertedIntoPeriod = duration.toDateTimePeriod()
println("days: $convertedIntoPeriod")
Lo naw oc, dki Yicmic wogu-qade wiwwulv jzamc gejgow feta lubkdeuqr, sad eg’t eijl mo ano ijy xepek at jire, uyw wepy roe ntize qhaaler tozo momra eq cemekiz sinv or imiqiqg hijvoxs.
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.