firstDayOfMonth static method

DateTime firstDayOfMonth(
  1. DateTime date
)

Returns DateTime that represents a beginning of the first day of the month containing date.

Example: (2020, 4, 9, 15, 16) -> (2020, 4, 1, 0, 0, 0, 0).

Implementation

static DateTime firstDayOfMonth(DateTime date) {
  return _date(date.isUtc, date.year, date.month);
}