Patrício
02/24/2024, 12:38 PMval birthDate = LocalDate.parse("2000-3-10")
throws the following exception: Exception in thread "main" kotlinx.datetime.DateTimeFormatException: java.time.format.DateTimeParseException: Text '2000-3-10' could not be parsed at index 5
, why I can't do that:
package org.example
import kotlinx.datetime.LocalDate
import kotlinx.datetime.DateTimeFormatException
fun main() {
try {
val birthDate = LocalDate.parse("2000-3-10")
} catch (e: DateTimeFormatException) {
// ...
}
}
?
It raises the following error: Cannot access 'DateTimeFormatException': it is internal in 'kotlinx.datetime'
What am I missing?
Thank youPatrício
02/24/2024, 12:47 PMimport java.time.format.DateTimeParseException
instead, does not workAdrijan Rogan
02/24/2024, 1:19 PMIllegalArgumentException
instead. https://github.com/Kotlin/kotlinx-datetime/issues/153