From 60595b9e872b2da8c301c750a69ad880e56cde1f Mon Sep 17 00:00:00 2001 From: Namnodorel Date: Mon, 20 Jul 2020 21:43:13 +0200 Subject: [PATCH] Quick fix for #991 (#998) The current fix for #991 missed the usage of `Timestamp.from()`. This change should fix that. --- .../org/jetbrains/exposed/sql/java-time/JavaDateColumnType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/java-time/JavaDateColumnType.kt b/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/java-time/JavaDateColumnType.kt index 1367c03881..87fd514509 100644 --- a/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/java-time/JavaDateColumnType.kt +++ b/exposed-java-time/src/main/kotlin/org/jetbrains/exposed/sql/java-time/JavaDateColumnType.kt @@ -106,7 +106,7 @@ class JavaLocalDateTimeColumnType : ColumnType(), IDateColumnType { override fun notNullValueToDB(value: Any): Any { if (value is LocalDateTime) { - return java.sql.Timestamp.from(value.atZone(ZoneId.systemDefault()).toInstant()) + return java.sql.Timestamp(value.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()) } return value }