-
Notifications
You must be signed in to change notification settings - Fork 55
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
Incorrect handling when clocks are moved backward? #23
Comments
Also, when using local, the problem does not exist: let t = Local.ymd_opt(1988, 09, 10).and_hms_opt(23, 59, 59);
println!("{}", t.unwrap().timestamp());
let tz: Tz = "Asia/Shanghai".parse().unwrap();
let t = tz.ymd_opt(1988, 09, 10).and_hms_opt(23, 59, 59);
println!("{}", t.unwrap().timestamp()); My time zone is Asia/Shanghai and the first one will success and the second one will fail. |
A friendly ping |
This issue has nothing to do with
use chrono::*;
fn main() {
let dt1 = chrono_tz::America::Los_Angeles.ymd_opt(2018, 3, 11).and_hms_opt(2, 15, 0);
let dt2 = Local.ymd_opt(2018, 3, 11).and_hms_opt(2, 15, 0);
println!("{:?}", dt1);
// None 👌
println!("{:?}", dt2);
// Single(2018-03-11T03:15:00-07:00) 😕
} |
This seems related to my issue, chrono #318. I found other related issues around this as well. |
Consider 06 November, 2011 01:59:59 AM in America/Los_Angeles:
According to time zone information:
So
06 November, 2011 01:59:59
is ambiguous, but the output isNone
.The text was updated successfully, but these errors were encountered: