toDateOnly method

  1. @useResult
DateTime toDateOnly()

Removes the time component from the DateTime object, returning only the date part (year, month, and day). Audited: 2026-06-12 11:26 EDT

Implementation

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