Top "Java-time" questions

The java.

How to skip weekends while adding days to LocalDate in Java 8?

Other answers here refer to Joda API. I want to do it using java.time. Suppose today's date is 26th …

java algorithm java-time
Java 8 - DateTimeFormatter and ISO_INSTANT issues with ZonedDateTime

So I would expect this code to work under the new Java 8 date/time package since all it does is …

java java-8 java-time
How to obtain the end of the day when given a LocalDate?

How to obtain the end of the day when given a LocalDate? I could get it by doing LocalDateTime.of(…

java java-time
Java 8 LocalDateTime today at specific hour

Is there a nicer/easier way of constructing LocalDateTime object representing today at 6 AM than this? LocalDateTime todayAt6 = LocalDateTime.now().…

java java-8 java-time
How can I return LocalDate.now() in milliseconds?

I create date now: ZoneId gmt = ZoneId.of("GMT"); LocalDateTime localDateTime = LocalDateTime.now(); LocalDate localDateNow = localDateTime.toLocalDate(); Then I want …

java-8 timestamp java-time localdate
Deserializing LocalDateTime with Jackson JSR310 module

I'm using the library described the Jackson Datatype JSR310 page but I'm still having difficulty getting it to work. I …

java jackson java-time jsr310
Unable to obtain ZonedDateTime from TemporalAccessor using DateTimeFormatter and ZonedDateTime in Java 8

I recently moved to Java 8 to, hopefully, deal with local and zoned times more easily. However, I'm facing an, in …

java timezone java-8 datetime-format java-time
LocalDateTime to java.sql.Date in java 8?

How to convert LocalDateTime to java.sql.Date in java-8? My search on internet mostly give me Timestamp related code …

java-8 java-time datetime-conversion
LocalDateTime to ZonedDateTime

I have Java 8 Spring web app that will support multiple regions. I need to make calendar events for a customer …

java spring-data-jpa postgresql-9.3 java-time
DateTimeFormatter Support for Single Digit Day of Month and Month of Year

DateTimeFormmater doesn't seem to handle single digit day of the month: String format = "MM/dd/yyyy"; String date = "5/3/1969"; System.out.…

java date java-8 java-time