In this article you can find parse and format date-time examples.
If parse() method is called without passing a DateTimeFormatter object then the default ISO format for that date object is used.
E.g. In the case of LocalDateTime, the default format is DateTimeFormatter.ISO_LOCAL_DATE_TIME.
For ZonedDateTime, the default format is DateTimeFormatter.ISO_ZONED_DATE_TIME.
Most of the below methods are also applicable for other date classes such as OffsetDateTime, LocalDate, LocalTime.
Note: Calling toString() on a date object prints the date / time in default ISO format.
Instant date format is always DateTimeFormatter.ISO_INSTANT. There is no format method for Instant, although toString() can be used.