formatTime static method

String formatTime(
  1. DateTime d, {
  2. Formatter formatter = Formatter.large,
  3. bool showAgo = true,
  4. bool showYesterday = false,
  5. DateFormat? df,
})

Format the given time by comparing with DateTime.now() and return the time difference in a intelligent format

final d = DateTime()

Implementation

static String formatTime(
  DateTime d, {
  Formatter formatter = Formatter.large,
  bool showAgo = true,
  bool showYesterday = false,
  DateFormat? df,
}) =>
    _formatTime(
      d,
      formatter,
      showAgo,
      showYesterday,
      df,
    );