Skip to content

Commit

Permalink
edit GLOBAL_OFFSET
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiujia committed Sep 30, 2024
1 parent 80f781b commit b8520e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
5 changes: 3 additions & 2 deletions src/datetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b8520e9

Please sign in to comment.