Top "Java-time" questions

The java.

Is there a jackson datatype module for JDK8 java.time?

I'm looking for a module for the new JDK8 java.time classes. I have looked through the FasterXML GitHub Project …

jackson java-8 java-time jackson-modules
How to set format of string for java.time.Instant using objectMapper?

I have an entity with java.time.Instant for created data field: @Getter @Setter @AllArgsConstructor @NoArgsConstructor @EqualsAndHashCode public class Item { …

java java-8 jackson java-time objectmapper
Java 8 date-time: get start of day from ZonedDateTime

Is there any difference between these: zonedDateTime.truncatedTo(ChronoUnit.DAYS); zonedDateTime.toLocalDate().atStartOfDay(zonedDateTime.getZone()); Any reason to prefer one …

java datetime java-8 java-time
Java 8 LocalDate - How do I get all dates between two dates?

Is there a usablility to get all dates between two dates in the new java.time API? Let's say I …

java date java-8 java-time
Error java.time.format.DateTimeParseException: could not be parsed, unparsed text found at index 10

I´m trying to pase the next String using LocalDateTime, but I always get de unparsed text found error: Error …

date java-8 java-time parse-error localdate
How to convert from Instant to LocalDate

I have an Instant coming from a source that should, according to the spec, be a LocalDate, but don't see …

java-8 localdate java.time.instant java-time
JPA support for Java 8 new date and time API

I'm using Java 8 for my new project. I'm trying to use new date and time api in java 8 however I …

java jpa java-8 jpa-2.1 java-time
How to check if a date Object equals yesterday?

Right now I am using this code Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); cal.set(cal.get(…

java date calendar java-time
How can I mock java.time.LocalDate.now()

In my test case, I need test time sensitive method, in that method we're using java 8 class LocalDate, it is …

java java-8 java-time systemtime
What's the difference between ZonedDateTime and OffsetDateTime?

I've read the documentation, but I still can't get when I should use one or the other: OffsetDateTime ZonedDateTime According …

java java-8 java-time