onlyDate property

DateTime get onlyDate

Returns DateTime object without time parameters.

Useful when you want to make collection of same dates.

  final dateOnly = DateTime.now();  // 16-09-2023 16:44:26:234567Z
  dateOnly.onlyDate;                // 16-09-2023 00:00:00:000000Z

Implementation

DateTime get onlyDate => DateTime(year, month, day);