Table of Contents

Java - LocalDate

About

javase/9/docs/api/java/time/LocalDate.html - A date in the ISO-8601 calendar system, such as 2007-12-03

Management

Init

in the default time zone

LocalDate localDate = LocalDate.of(year,month,day);
LocalDate localDate = LocalDate.parse("2009-01-01",DateTimeFormatter.ISO_DATE);
LocalDate localDate = LocalDate.now();

Print

sout(localDate.format(DateTimeFormatter.ISO_DATE));

Between

import static java.time.temporal.ChronoUnit.DAYS;
DAYS.between(from,to)

Format

With javase/9/docs/api/java/time/format/DateTimeFormatter.html. Note this is a datetime otherwise

LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd-HHmm"))

note: