home ~ projects ~ socials

Get The Current DateTime Timezone Offset In Rust

---
[dependencies]
chrono = "0.4.40"
---

use chrono::offset::Local;

fn main() {
  let now = Local::now();
  println!("{}", now.offset());
}
Output:
-04:00
-- end of line --