toDateString static method

String toDateString(
  1. DateTime date
)

Extract the date portion (YYYY-MM-DD) from a DateTime object.

Implementation

static String toDateString(DateTime date) {
  return date.toUtc().toIso8601String().split('T').first;
}