Guest User

Untitled

a guest
Jun 24th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. extern crate chrono;
  2.  
  3. use chrono::NaiveDate;
  4. use chrono::Duration;
  5.  
  6. fn from_days_since_1900(days_since_1900: i64) -> NaiveDate {
  7. let d1900 = NaiveDate::from_ymd(1900, 1, 1);
  8. d1900 + Duration::days(days_since_1900)
  9. }
  10.  
  11. fn main() {
  12. println!("{}", from_days_since_1900(40000));
  13. }
Add Comment
Please, Sign In to add comment