| Metadata | Value |
|---|---|
| Status | Active |
| Version | 1.1.0 |
| Last Updated | 2026-09-10 |
| Author | Sangeetha Grantha Team |
| Document Type | Decision record |
kotlin.time.Instant[!NOTE] Decision record: preserve the original rationale and check its decision/supersession status. Current runtime guidance is in system architecture and Flyway migrations.
Kotlin 2.0+ (specifically 2.3.0) and kotlinx-datetime 0.7.0+ have introduced a major shift in date-time handling. The representation of “an instantaneous point on the timeline” has moved from the external kotlinx-datetime library to the Kotlin Standard Library.
kotlinx.datetime.Instant (Legacy)
org.jetbrains.kotlinx:kotlinx-datetime library.kotlin.time.Instant (Recommended)
kotlin-stdlib).| Feature | kotlinx.datetime.Instant |
kotlin.time.Instant |
|---|---|---|
| Source | External Library (kotlinx-datetime) |
Standard Library (stdlib) |
| Dependency | Requires kotlinx-datetime |
No extra dependency |
| Kotlin Version | Any | Kotlin 2.1+ (Stable in 2.3.0) |
| Interoperability | Good with kotlinx-serialization < 1.10.0 |
Native in kotlinx-serialization 1.10.0+ |
| Future Proof | ❌ No | ✅ Yes |
In kotlinx-datetime 0.7.0, Instant becomes a typealias to kotlin.time.Instant. However, binary compatibility issues can arise if:
Exposed) are compiled against the old version.kotlinx.datetime.Instant but APIs expect kotlin.time.Instant (or vice versa during the transition).We should standardise on kotlin.time.Instant across all modules.
import kotlinx.datetime.Instant with import kotlin.time.Instant.kotlinx-serialization 1.10.0+ is used (which supports stdlib Instant).ResultRowExtensions.kt to return kotlin.time.Instant.kotlin.time.Instant.shared:domain, backend:dal, backend:api, mobile.This migration should be tracked as TRACK-019.