MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / intToDate

Function intToDate

Miscellaneous/Dates.cpp:8–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6 d - 32075;
7}
8void intToDate(int jd, int &y, int &m, int &d) {
9 int x, n, i, j;
10 x = jd + 68569;
11 n = 4 * x / 146097;
12 x -= (146097 * n + 3) / 4;
13 i = (4000 * (x + 1)) / 1461001;
14 x -= 1461 * i / 4 - 31;
15 j = 80 * x / 2447;
16 d = x - 2447 * j / 80;
17 x = j / 11;
18 m = j + 2 - 12 * x;
19 y = 100 * (n - 49) + i + x;
20}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected