Top "Java-time" questions

The java.

Java: check if a given date is within current month

I need to check if a given date falls in the current month, and I wrote the following code, but …

java date java-time java.util.date
How to persist JSR-310 types with Spring Data JPA?

I am trying to use Spring Data JPA 1.8 with the Java 8 Date/Time API JSR-310. Everything seems to work, until …

jpa java-8 spring-data spring-data-jpa java-time
Java 8 Time API: how to parse string of format "MM.yyyy" to LocalDate

I'm a bit discouraged with parsing dates in Java 8 Time API. Previously I could easily write: String date = "04.2013"; DateFormat df = …

java date java-8 java-time
how to get a formatted date as milliseconds?

I have a formatted date from sqllite database, to use this in a graph view I need to format it …

java android date java-time datetime-parsing
How to remove milliseconds from LocalTime in java 8

Using the java.time framework, I want to print time in format hh:mm:ss, but LocalTime.now() gives the …

java rounding datetime-format java-time localtime
Convert "duration" "Unit" to milliseconds

I want to have an API that looks like public static long toMillis ( long duration, ChronoUnit unit ) { // magic duration to …

java java-time
Can't parse String to LocalDate (Java 8)

My input is a String representation of a date in the format "01-07-2015" for July 1, 2015. I'm trying to parse …

java datetime java-8 java-time
Hibernate with Java 8 LocalDate & LocalDateTime in Database

My requirement is to store all dates & date-times in UTC timezone in the database. I am using Java 8's …

java hibernate utc java-time
What does 'PT' prefix stand for in Duration?

I am trying to use the Duration class instead of long. It has superior literal syntax. I like its flexibility, …

java duration java-time iso8601 period
Is there a class in java.time comparable to the Joda-Time Interval?

I'm evaluating to migrate my project from the usage of Joda-Time to the java.time package in Java 8. In Joda-Time, …

java-8 jodatime java-time