https://kotlinlang.org logo
#exposed
Title
# exposed
n

Nikky

03/18/2020, 4:20 PM
i am trying to put datetimes in with exposed.. .. my local timezone is
Europe/Berlin
so i tried converting them like so
Copy code
ISODateTimeFormat.dateTimeParser().parseDateTime(dateString).withZone(DateTimeZone.UTC)
and logging shows me the field should be
2020-03-18T16:17:00.000Z
but when i look into the database i see
2020-03-18 17:17:00
this looks almost as if exposed converts to the local timezone and then discards the timezone info (or
DATETIME
has no timezone info?) how can i make sure i save stuff as
UTC
always ?
s

spand

03/18/2020, 7:50 PM
Set the TimeZone default to UTC first thing in your main method
2 Views