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

Function dateToInt

Miscellaneous/Dates.cpp:2–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1int intToDay(int jd) { return jd % 7; }
2int dateToInt(int y, int m, int d) {
3 return 1461 * (y + 4800 + (m - 14) / 12) / 4 +
4 367 * (m - 2 - (m - 14) / 12 * 12) / 12 -
5 3 * ((y + 4900 + (m - 14) / 12) / 100) / 4 +
6 d - 32075;
7}
8void intToDate(int jd, int &y, int &m, int &d) {
9 int x, n, i, j;
10 x = jd + 68569;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected