You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
will be non-deterministic. The same code will insert a different value depending on the machine where it's run.
My suggestion would be to make dates use UTC by default.
EDIT: it seems this happened because I had created the column via regular SQL as a timetamptz (Postgres) so there was a mismatch. Even though JavaLocalDateColumnType's SQL type is DATE it continued to work, albeit incorrectly, not sure if this should be a bug or not.
The text was updated successfully, but these errors were encountered:
Java's LocalDate and SQL's DATE are both timezone-free. So there should be no timezone conversion required.
However, JavaLocalDateColumnType converts to a java.sql.Date using the local timezone. This means that, for example, in UTC+n timezones a LocalDate of 1991-01-01 will be stored as 1990-12-31.
When using
date
as a table column (Column<LocalDate>
) the value saved to the DB depends on the timezone of the system. This means something likewill be non-deterministic. The same code will insert a different value depending on the machine where it's run.
My suggestion would be to make dates use UTC by default.
EDIT: it seems this happened because I had created the column via regular SQL as a
timetamptz
(Postgres) so there was a mismatch. Even thoughJavaLocalDateColumnType
's SQL type isDATE
it continued to work, albeit incorrectly, not sure if this should be a bug or not.The text was updated successfully, but these errors were encountered: