Skip to content

Upgrading org.jetbrains.kotlinx:kotlinx-datetime 0.6 to 0.7

Breaking0.6.2 → 0.7.1-0.6.x-compatBreaking7New3Fixed5

BreakingUpgrade verdict

7 breaking changes.

  • Remove kotlinx.datetime.Instant and kotlinx.datetime.Clock in favor of kotlin.time.Instant.
  • Rename dayOfMonth to day, monthNumber to month.
  • Make DayOfWeek and Month no longer type aliases to java.time.DayOfWeek and java.time.Month.
  • Add DateTimeFormat-based KSerializer implementations for datetime entities, and change the default serializers to be based on toString/parse pairs.
Top 3 of 7 that need code or config changes
Breaking7
Remove kotlinx.datetime.Instant and kotlinx.datetime.Clock in favor of kotlin.time.Instant.
kotlinx.datetime.Instantkotlinx.datetime.Clockkotlin.time.Instant
Rename dayOfMonth to day, monthNumber to month.
dayOfMonthdaymonthNumbermonth
Make DayOfWeek and Month no longer type aliases to java.time.DayOfWeek and java.time.Month.
DayOfWeekMonthjava.time.DayOfWeekjava.time.Month
Add DateTimeFormat-based KSerializer implementations for datetime entities, and change the default serializers to be based on toString/parse pairs.
DateTimeFormatKSerializertoStringparse
Unify the range of admissible LocalDate and LocalDateTime values on all platforms.
LocalDateLocalDateTime
Make "UTC" and not "Z" be the timezone identifier for TimeZone.UTC.
"UTC""Z"TimeZone.UTC
Accept "z" in TimeZone.of, with the same meaning as "Z".
"z"TimeZone.of"Z"