julianDayNumber property

  1. @override
int get julianDayNumber
override

Calculates the Julian Day number from Gregorian or Julian calendar dates. This integer number corresponds to the noon of the date (i.e. 12 hours of Universal Time).

The procedure was tested to be good since 1 March, -100100 (of both calendars) up to a few million years into the future.

Implementation

@override
int get julianDayNumber {
  return (((year + ((month - 8) ~/ 6) + 100100) * 1461) ~/ 4) +
      ((153 * ((month + 9) % 12) + 2) ~/ 5) +
      day -
      34840408 -
      ((((year + 100100 + ((month - 8) ~/ 6)) ~/ 100) * 3) ~/ 4) +
      752;
}