format method

String format([
  1. String? format
])

Returns date formatted string with support for custom format

Implementation

String format([String? format]) {
  return DateFormat.format(this, format ?? 'yyyy-MM-dd HH:mm:ss');
}