We would like to know how to format local date in ISO date format.
/*w w w . j av a2 s.com*/ import java.time.LocalDate; import java.time.format.DateTimeFormatter; public class Main { public static void main(String[] argv) { String s = LocalDate.now().format(DateTimeFormatter.ISO_DATE); System.out.println(s); } }
The code above generates the following result.