dayInYear property

int get dayInYear

Day in year.

The number of days in the year up to and including the current day. The day-in-year of the 1st of January is 1.

A date date can be recreated by Date(date.year, 1, date.dayInYear).

Implementation

int get dayInYear {
  final startOfYear = DateTime.utc(year);
  return 1 + (_time.millisecondsSinceEpoch - startOfYear.millisecondsSinceEpoch) ~/ Duration.millisecondsPerDay;
}