Francesco Di Sciascio
11/10/2022, 9:25 PMval endTime = datetime("end_time")
and the data class has
val endTime: LocalDateTime?
in my DAOFacadeImpl class I perform the mapping between row and object as follows:
endTime = row[Events.endTime].toString().toLocalDateTime(),
but I have the following exception:
kotlinx.datetime.DateTimeFormatException: java.time.format.DateTimeParseException: Text '2014-01-26T17:30:00.000+01:00' could not be parsed, unparsed text found at index 23
I'm using kotlinx.datetime because it supports the object Serialization.
I suppose that the date read from database is not in ISO format (in the database I do not have the +01:00), but how to change its format to be an ISO format?
Any suggestion about?
thanks alltapac
11/15/2022, 9:53 AMdatetime
column from exposed-kotlin-datetime already has LocalDateTime
type. What column type is in your database?Francesco Di Sciascio
11/15/2022, 1:32 PMFrancesco Di Sciascio
11/15/2022, 1:33 PMrow[Events.endTime].toString().toInstant().toLocalDateTime(TimeZone.currentSystemDefault())
Francesco Di Sciascio
11/15/2022, 1:35 PMdatetime
type for column endTime
depends on org.jetbrains.exposed.sql.jodatime