toLocalDate method

LocalDate toLocalDate()

Converts this DateTime to a LocalDate, ignoring the time and timezone.

DateTime(2023, 10, 10, 10, 30).toLocalDate(); // LocalDate(2023, 10, 10)

DateTime.utc(2023, 10, 10, 10, 30).toLocalDate(); // LocalDate(2023, 10, 10)

Implementation

LocalDate toLocalDate() => LocalDate(year, month, day);