-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic in conversion of NaiveDateTime to the local time on Windows #977
Comments
This looks like a bug. Assuming you're on 0.4.x, the code says: tm_year: d.year() - 1900, // this doesn't underflow, we know that d is `NaiveDateTime`. Which indicates the comment is clearly wrong? This code seems to be using a So the Windows code here seems pretty broken. Would you be interested in helping to fix it? That would be great. |
@djc, sure. I can try to fix it |
Code like this works fine:
But changing of the first line to
causes a panic:
thread 'datetime::tests::test_from_naive_date_time_conversions' panicked at 'attempt to subtract with overflow', src\offset\local\windows.rs:223:18
I face this problem on Windows only. So what range of datetime should be supported by functions
Local.from_utc_datetime
andLocal.from_local_datetime
on Windows?The text was updated successfully, but these errors were encountered: