toDate method

DateTime toDate()

Create a new DateTime by extracting only the year and month from DateTime.

All hours, minutes, and seconds will be 0.

DateTimeから年月日のみを抽出して新しいDateTimeを作成します。

時刻分秒はすべて0になります。

Implementation

DateTime toDate() {
  return DateTime(year, month, day);
}