0PricingLogin
Kotlin Multiplatform Academy · Lesson

Dates with kotlinx-datetime

A multiplatform-safe way to handle time and dates.

Dates Need a Library

The core stdlib has no shared date type, so KMP uses kotlinx-datetime, an official multiplatform library for time.

Add the Dependency

You pull kotlinx-datetime into commonMain in your build file, and then every target can work with dates the same way.

implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")

All lessons in this course

  1. Strings, Numbers & Collections Everywhere
  2. map, filter & fold in Shared Code
  3. Dates with kotlinx-datetime
  4. What Is NOT in Common stdlib
← Back to Kotlin Multiplatform Academy