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
I tried to use LocalDateTime as attribute type of an entity. After I saved this entity to mongo, the date field was translated to ISO date, which seems "right" in string form, but in fact beyond of actual epoch timestamp by 8 hours(cause my time zone is UTC+8). Was this expected behaviour?
The text was updated successfully, but these errors were encountered:
shpirt
changed the title
Storing LocalDateTime using Kmongo
Store LocalDateTime using Kmongo
Aug 12, 2022
Yes, this is the current expected behaviour. Mongo has no notion of timezone is their date field, so all date types are converted to UTC before serialization and from UTC after deserialization.
I agree that it is not ideal, especially for LocalDateTime, LocalDate & LocalTime. I let this issue open in order to provide an option to:
store Local* with the local part in mongo
add also a zone storage for ZonedDateTime, OffsetDateTime, etc.
Workaround : just override the serializer & deserializer for the types you use to get the expected behaviour.
I tried to use LocalDateTime as attribute type of an entity. After I saved this entity to mongo, the date field was translated to ISO date, which seems "right" in string form, but in fact beyond of actual epoch timestamp by 8 hours(cause my time zone is UTC+8). Was this expected behaviour?
The text was updated successfully, but these errors were encountered: