package date;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAccessor;
/**
* java.time.format.DateTimeFormatter 类似于simpleDateFormat
*/
public class DateTimeFormatter1 {
public static void main(String[] args) {
DateTimeFormatter dateTimeFormatter= DateTimeFormatter.ofPattern("yyyy-MM-dd");
String date=dateTimeFormatter.format(LocalDate.now());
System.out.println(date);
TemporalAccessor ld=dateTimeFormatter.parse("2020-03-29");
System.out.println(ld);
}
}