Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-1243

Add converters Instant <-> LocalDateTime

    XMLWordPrintable

    Details

      Description

      Add converters between LocalDateTime and Instant (both directions).

      This enables usage of Instant for AuditAware which is arguably the correct type to use.

      We (correctly) declined to encourage the use of ZonedDateTime because the time zone is really more of a presentation layer concern.

      But the use of LocalDateTime is problematic as well. It does NOT represent a point of time but does so ONLY together with a timezone. The current implementation of CurrentDateTimeProvider uses the JVM default timezone.
      If an application runs in a cluster across time zones this results in values of LocalDateTime values that can't be compared anymore.

      If one uses Instant though there is no timezone involved, yet it specifies a point in time.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              schauder Jens Schauder
              Reporter:
              schauder Jens Schauder
              Last updater:
              Oliver Drotbohm
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: