Utc::now with timezone and with summer hour

I have the following code to get the current hour in my timezone:

let current_time = chrono::Utc::now().with_timezone(&chrono::FixedOffset::east(3600));
let current_hour =
            chrono::NaiveTime::from_hms(current_time.hour(), current_time.minute(), 0);

This worked perfectly until a few weeks ago. We switched from "winter-time" to "summer-time" and now the current hour is one hour wrong. How would I solve this? Is there another function to handle this? Thanks!

let current_time = chrono::Local::now();
1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.