dayOfYear static method

  1. @useResult
int dayOfYear(
  1. int year,
  2. int month,
  3. int day
)

Computes the ordinal day of the year.

Dates.dayOfYear(2023, 4, 1); // 91

Implementation

@useResult static int dayOfYear(int year, int month, int day) => _cumulative[month - 1] + day + (leapYear(year) && month > 2 ? 1 : 0);