The toEpochDay() method of a ChronoLocalDate interface is used to get this date as a EpochDay. The EpochDay is the count of the day from the 0 EpochDay which is the 1970-01-01 (ISO). The output will be in the ISO-8601 format yyyy-MM-dd.
default long toEpochDay()
Parameters: This method does not accepts any parameters.
Return value: This method returns a long value which is the EpochDay count of this date, not null.
Below programs illustrate the toEpochDay() method:
ChronoLocalDate as EpochDay: 17871
ChronoLocalDate as EpochDay: 18808
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.