solarToInt method

int solarToInt(
  1. int y,
  2. int m,
  3. int d
)

Implementation

static int solarToInt(int y, int m, int d) {
  m = (m + 9) % 12;
  y = y - (m / 10).toInt();
  return (365 * y +
      (y / 4).toInt() -
      (y / 100).toInt() +
      (y / 400).toInt() +
      ((m * 306 + 5) / 10).toInt() +
      (d - 1));
}