public default String format (DateTimeFormatter formatter)

Formats this date-time using the specified formatter.

This date-time will be passed to the formatter to produce a string.

The default implementation must behave as follows:

  return formatter.format(this);
 

Parameters:
formatter    the formatter to use, not null

Returns:  the formatted date-time string, not null

Exceptions:
DateTimeException    if an error occurs during printing