Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
changhc committed Oct 25, 2024
1 parent 13ae4f2 commit c3338e8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,8 @@ impl Date {
/// assert_eq!(d.timestamp(), 1_654_560_000);
/// ```
pub fn timestamp(&self) -> i64 {
let days = (self.year as i64) * 365
+ (self.ordinal_day() - 1) as i64
+ intervening_leap_years(self.year as i64);
let days =
(self.year as i64) * 365 + (self.ordinal_day() - 1) as i64 + intervening_leap_years(self.year as i64);
days * 86400 + UNIX_0000
}

Expand Down

0 comments on commit c3338e8

Please sign in to comment.