MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / dateToInt

Function dateToInt

code/other/dates.cpp:2–6  ·  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; }
7void intToDate(int jd, int &y, int &m, int &d) {
8 int x, n, i, j;
9 x = jd + 68569;

Callers 1

testFunction · 0.85

Calls

no outgoing calls

Tested by 1

testFunction · 0.68