![](/img/trans.png)
[英]@ApiModelProperty with dataType java.time.LocalDate not resolvable
[英]Import failing for java.time.LocalDate
import java.time.LocalDate;
import java.time.Period;
public class DateDiff {
public static void main(String[] args) {
/** The date at the end of the last century */
LocalDate endofCentury = LocalDate.of(2000, 12, 31);
LocalDate now = LocalDate.now();
Period diff = Period.between(endofCentury, now);
System.out.printf("The 21st century (up to %s) is %s old%n", now, diff);
System.out.printf("The 21st century is %d years, %d months and %d days old",
diff.getYears(), diff.getMonths(), diff.getDays());
}
}
我缺少导入指令时找不到本地日期
检查您是否正在使用JDK 8。
我想你不是,那是你的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.