package fr.yunes; import java.time.LocalDate; import java.time.Month; import java.time.format.DateTimeFormatter; import java.time.temporal.TemporalAccessor; import java.util.Locale; public class Date7 { public static void main(String []args) { LocalDate naissanceDonaldTrump = LocalDate.of(1946, Month.JUNE,14); System.out.println("Donald est né un "+naissanceDonaldTrump.getDayOfWeek()); DateTimeFormatter jourDeLaSemaine = DateTimeFormatter.ofPattern("EEEE"); System.out.println("Donald est né un "+naissanceDonaldTrump.format(jourDeLaSemaine)); DateTimeFormatter jourDeLaSemaineEnChinois = DateTimeFormatter.ofPattern("EEEE", Locale.CHINA); System.out.println("Donald est né un "+jourDeLaSemaineEnChinois.format(naissanceDonaldTrump)); DateTimeFormatter test = DateTimeFormatter.ofPattern("uuuu-MMMM-dd",Locale.ENGLISH); System.out.println(test.format(naissanceDonaldTrump)); LocalDate date = LocalDate.parse("1946-June-14",test); System.out.println(date); } }