toDateString method

String toDateString()

Formats this DateTime's date as a ISO-8601 date, ignoring the time.

DateTime(2023, 4, 1, 10, 30).toDateString(); // 2023-04-01

Implementation

String toDateString() => Dates.format(year, month, day);