Skip to content

Commit 1d3da21

Browse files
committed
Add comment to calculate UNIX_EPOCH_DAY
1 parent 83573a8 commit 1d3da21

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/datetime/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,6 +1903,14 @@ where
19031903
}
19041904
}
19051905

1906+
/// Number of days between Januari 1, 1970 and December 31, 1 BCE which we define to be day 0.
1907+
/// 4 full leap year cycles until December 31, 1600 4 * 146097 = 584388
1908+
/// 1 day until January 1, 1601 1
1909+
/// 369 years until Januari 1, 1970 369 * 365 = 134685
1910+
/// of which floor(369 / 4) are leap years floor(369 / 4) = 92
1911+
/// except for 1700, 1800 and 1900 -3 +
1912+
/// --------
1913+
/// 719163
19061914
const UNIX_EPOCH_DAY: i64 = 719_163;
19071915

19081916
#[cfg(all(test, any(feature = "rustc-serialize", feature = "serde")))]

0 commit comments

Comments
 (0)