Skip to content

Commit

Permalink
Add test for issue 651
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Apr 19, 2023
1 parent 4bb2aa6 commit d3be65b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/datetime/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,15 @@ fn test_datetime_from_local() {
assert_eq!(datetime_west, datetime_utc.with_timezone(&timezone_west));
}

#[test]
fn test_issue_651() {
// dt corresponds to `FILETIME = 147221225472` from the issue.
// This used to fail on Windows for timezones with an offset of -5:00 or greater.
let dt = NaiveDate::from_ymd_opt(1601, 1, 1).unwrap().and_hms_milli_opt(4, 5, 22, 122).unwrap();
let local_dt = Local.from_utc_datetime(&dt);
dbg!(local_dt);
}

#[test]
#[cfg(feature = "clock")]
fn test_years_elapsed() {
Expand Down

0 comments on commit d3be65b

Please sign in to comment.