Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for persisting OffsetDateTime/ZonedDateTime [DATAJDBC-414] #635

Open
spring-projects-issues opened this issue Sep 13, 2019 · 2 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

Milan Milanov opened DATAJDBC-414 and commented

Currently the supported date types are only java.util.Date, java.time.LocalDate, java.time.LocalDateTime and java.time.LocalTime. This could be improved by adding built-in converters for the java.time.OffsetDateTime and java.time.ZonedDateTime, as they both provide actual moments in time as opposed to their Local alternatives. They are also generic and widely used java.time types


Issue Links:

@spring-projects-issues
Copy link
Author

Milan Milanov commented

Again Jens Schauder, i'd be happy to try and tackle this, with the necessary guidance :)

@spring-projects-issues
Copy link
Author

Jens Schauder commented

I don't want to add logic for Zoned* variants of date and time types.
In almost all cases we have seen, the timezone should not be tied to the date type, but some other object (the location where an event is happening, the location where a user is located ..) and therefore stored separately.

The combination of a date/time with a timezone is then really part of the presentation layer.

If you want to represent a point in time Instant is most often the right time to use at least on the persistence side of things which is also supported by Spring Data JDBC.

If your database/JDBC driver directly supports Zoned* types you should be able to register it as a simple type.
Doing so for databases that support it would be a valid issue/PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants