Top "Java-time" questions

The java.

Parse ISO timestamp using Java 8 java.time api (standard edition only)

I'm having trouble getting milliseconds from the epoch out of the string in the example. I have tried this three …

java datetime java-8 string-parsing java-time
Difference between year-of-era and week-based-year?

Java 8's DateTimeFormatter class has a method, ofPattern(String pattern), that lets you define a format from a string of …

java date datetime java-8 java-time
Convert java.sql.Timestamp to Java 8 ZonedDateTime?

Migrating Joda time to Java 8 Joda: UserObject user = new UserObject() user.setCreatedAt(new DateTime(rs.getTimestamp("columnName")));` Migrating to Java 8 …

java sql java-8 java-time zoneddatetime
converting Joda time Instant to Java time Instant

I have an instance of Instant (org.joda.time.Instant) which I get in some api response. I have another …

java time jodatime java-time java.time.instant
Set the time-of-day on a ZonedDateTime in java.time?

How can I alter the time-of-day portion of an existing ZonedDateTime object? I want to keep the date and time …

java java-time zoneddatetime
Persist java.time.Instant (JDK8) with JPA2/Hibernate

Neither JPA nor Hibernate currently support the new date/time classes brought by JSR-310 in JDK8 (JPA ticket, Hibernate ticket). …

hibernate jpa jpa-2.0 java-8 java-time
What is the equivalent format string of DateTimeFormatter.ISO_OFFSET_DATE_TIME?

Do we know if there is an equivalent format string that outputs the same result as DateTimeFormatter.ISO_OFFSET_DATE_…

java java-8 java-time datetimeformatter
Why does the new Java 8 Date Time API not have nanosecond precision?

One of the features of the new Date Time API in Java 8 is supposed to be nanosecond precision. However when …

java java-8 java-time
What is the difference between year and year-of-era?

The DateTimeFormatter class documentation defines separate symbols u for year and y year-of-era: https://docs.oracle.com/javase/8/docs/api/…

java-8 java-time
Mapstruct LocalDateTime to Instant

I am new in Mapstruct. I have a model object which includes LocalDateTime type field. DTO includes Instant type field. …

java-time mapstruct datetime-conversion localdate java.time.instant