From b8520e918e67c2d19b2172937ffd41257e5d896a Mon Sep 17 00:00:00 2001 From: zxj Date: Mon, 30 Sep 2024 10:54:06 +0800 Subject: [PATCH] edit GLOBAL_OFFSET --- Cargo.toml | 2 +- src/datetime.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d719491..31e4002 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fastdate" -version = "0.3.33" +version = "0.3.34" edition = "2021" description = "Rust fast date carte" readme = "Readme.md" diff --git a/src/datetime.rs b/src/datetime.rs index c05ba50..828e619 100644 --- a/src/datetime.rs +++ b/src/datetime.rs @@ -11,11 +11,12 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH}; use time1::format_description::well_known::Rfc3339; use time1::UtcOffset; -static GLOBAL_OFFSET: AtomicI32 = AtomicI32::new(-9999); + +static GLOBAL_OFFSET: AtomicI32 = AtomicI32::new(-99999); /// offset with utc 0.zone pub fn offset_sec() -> i32 { - if GLOBAL_OFFSET.load(Ordering::Relaxed) == -9999 { + if GLOBAL_OFFSET.load(Ordering::Relaxed) == -99999 { GLOBAL_OFFSET.store(Timespec::now().local().tm_utcoff, Ordering::SeqCst); } GLOBAL_OFFSET.load(Ordering::Relaxed)