# LocalDate.fromDateTime constructor

LocalDate.fromDateTime(

1. DateTime dateTime

)

Creates a LocalDate from a DateTime object.

Time components are ignored.

Example:

    final dt = DateTime(2023, 3, 10, 14);
    final date = LocalDate.fromDateTime(dt); // 2023-03-10

Represents a calendar date without time or timezone.

This class provides date-only operations such as computing weekdays, adding or subtracting days/months/years, and converting from/to strings.

It ensures valid dates (e.g. February never has more than 29 days).

### Example

    final date = LocalDate(2024, 6, 27);
    print(date); // "2024-06-27"

## Implementation

    factory LocalDate.fromDateTime(DateTime dateTime) {
      return LocalDate(dateTime.year, dateTime.month, dateTime.day);
    }