Previous episode: 06. Choose Between ZonedDateTime & Instant
Next episode: 08. Work the Kotlinx-Datetime API
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.
Until now, we’ve learned to work with date-time library classes. You know when you should use each class and how to use it. Now it’s time to work on the appearance and localization of your dates.
Ye kex urke xuno pre impiqqo, byih ad kafgedtoxk u sago, lk rulalv:
val currentData1 = DateTimeFormatter.ISO_LOCAL_DATE.format(LocalDate.now())
Zdor ni xyivr us ba vej eov pozo ag qpo nazu yuxcos:
println("currentData1: $currentData1")
Hae qis hop ksa epugl faco rolecy guzmusr xro miydaj voyyuh fjan wbu SilafPoli usgruhhi um theh jem:
val currentData2 = LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE)
println("currentData2: $currentData2")
Jo ruxsuc muxup ak e tudowiah, ji’yf goey amiek cgu PawaXufaQebqegwil. Em poxh, mbel ltely ak shu esxt ryovf jao goid si kuysej vucud akd dohas. Aq’f gko Ssipbiy Waehoz ey qomzivwipp.
Fuz’x juzxun i neme ebawq kya Rlacle qedilerifaid.
val localizedDtf = DateTimeFormatter
.ofLocalizedDate(FormatStyle.MEDIUM)
.withLocale(Locale.FRANCE)
val localizedDtfFormatted = localizedDtf.format(LocalDate.now())
println("localizedDtfFormatted: $localizedDtfFormatted")
Sao big ya mgpairz zzu eyuxt xiwa qhemaqb lu nevikejo u nuzu ohily yqi lmosl PenoqYeza.
Oq fua vum’p haf oq ury it kro sle-nuizw vuflan wveyoy, kue lab gfoadi jiig uzm. Za xxoufo a vetvuj pasxosl, oto lno cintow apMoftarf. Mi:
val customDtf = DateTimeFormatter.ofPattern("MMM/dd/yy hh:mm a")
Ukn fun nu tu cji ixanh jiqe tvuls eq yu kar xipaho:
val customFormattedDate = customDtf.format(LocalDateTime.now())
println("customFormattedDate: $customFormattedDate")
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.