Skip to content

Commit

Permalink
Add comment to calculate UNIX_EPOCH_DAY
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Feb 29, 2024
1 parent 9a17072 commit 932202f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/datetime/mod.rs
Expand Up @@ -1881,6 +1881,14 @@ where
}
}

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

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

0 comments on commit 932202f

Please sign in to comment.