LocalDate.EPOCH is not available

Bastian S :

I need to normalise some Data to execute a SQL-Statement. Unfortunately I can't initialize a LocalDate-variable with LocalDate.EPOCH. MIN and MAX are working.

startDatum = startDatum == null? LocalDate.EPOCH : startDatum; // doesn't work
endDatum = (endDatum == null)? LocalDate.MAX : endDatum; // works

Eclipse only says EPOCH cannot be resolved or is not a field

marstran :

The EPOCH field on LocalDate was new in Java 9. If you're using Java 8, you can do the following to get the LocalDate at epoch:

LocalDate.ofEpochDay(0)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=142306&siteId=1