I’m confused at how exposed handles `LocalDate` (...
# exposed
a
I’m confused at how exposed handles
LocalDate
(via the
JavaLocalDateColumnType
class).
LocalDate
does not contain a timezone, but
JavaLocalDateColumnType
converts the
LocalDate
to a
java.sql.Date
object using the local timezone. This means that, if my timezone is UTC+n, saving a
LocalDate
of, for example
1991-01-01
will put
1990-12-31
in the DB. Have I misunderstood or overlooked something? This behaviour doesn’t seem to be correct. SQL `DATE`s are timezone free, so are
LocalDate
s so there shouldn’t be any timezone conversion happening.
a
Not really, I’m talking about
LocalDate
which is not a point in time. That’s about
Instant
, which is. I just found https://github.com/JetBrains/Exposed/issues/886, which I’ve added a comment to.