Migrate custom date objects and logic to Java 8's Date / Time API
See original GitHub issueRather than using the custom-rolled DateTime
, Period
, Dur
, etc. objects, migrate to using Java 8’s Date / Time API (Instant
, Period
, Duration
, etc.).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Migrating to the New Java 8 Date Time API - Baeldung
In this tutorial you will learn how to refactor your code in order to leverage the new Date Time API introduced in Java...
Read more >Convert java.util.Date to what “java.time” type? - Stack Overflow
Given that both Instant and java.util.Date are a moment on the timeline in UTC, we can easily move from a java.util.Date to an...
Read more >New Date-Time API in Java 8 - GeeksforGeeks
Local : Simplified date-time API with no complexity of timezone handling. Zoned : Specialized date-time API to deal with various timezones.
Read more >Java SE 8 Date and Time - Oracle
The first classes you will probably encounter when using the new API are LocalDate and LocalTime . They are local in the sense...
Read more >Java 8 Date Time - 20 Examples of LocalDate, LocalTime ...
One of the many good things about new Date and Time API is that now it defines principle date-time concepts e.g. instants, duration,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Migration to new date/time API will be an extensive project and will likely see a number of alpha releases prior to completion (propose to use 3.1.x release versioning before final release of 4.x).
Points to note as part of migration:
TemporalAdapter
to support parsing/formatting Temporal valuesInstant
as the Temporal type such that local/zone-based values aren’t permitted.Recur
) we should use generics where possible to support applicable Temporal types (i.e.Instant
= UTC time,OffsetDateTime
= zone-based time without DST rules, etc.,ZonedDateTime
= DST rules,LocalDate
= date-only values)v4 now in beta.