toDateOnly method

DateTime toDateOnly()

Removes the time component from the DateTime object, returning only the date part (year, month, and day).

Implementation

DateTime toDateOnly() => DateTime(year, month, day);