format method

String format(
  1. String formatPattern, [
  2. bool utc = false
])

Formats this time instance using the provided format string.

TimeFormat class provides static format strings. If utc is true, formats the time in UTC.

Implementation

String format(String formatPattern, [bool utc = false]) =>
    DateFormat(formatPattern).format(utc ? _dateTime.toUtc() : _dateTime);