Oreo
Oreo

Reputation: 2594

Android Eclipse LocalDate cannot be resolved to a type

I am working with Android Eclipse ADT and Java Compiler 1.7, getting:

LocalDate cannot be resolved to a type

Here is my code:

LocalDate birthdate = new LocalDate (1970, 1, 20); // Birth date
LocalDate now = new LocalDate(); // Today's date
Period period = new Period(birthdate, now, PeriodType.yearMonthDay());

Upvotes: 0

Views: 2201

Answers (1)

Jens
Jens

Reputation: 69470

LocalDate is introduced in Java 8 so there is no cuch class in java 7. You have to change to java.util.Date if you are using java 7 or you have to use a java 8 compiler.

For more informations read the official documentation.

Upvotes: 2

Related Questions