Skip to content

Commit 6c0ef73

Browse files
committed
feat: use local timezone
1 parent 0f51a9f commit 6c0ef73

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

aw-firebase-sync/src/main.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use aw_client_rust::AwClient;
2-
use chrono::Utc;
2+
use chrono::Local;
33
use dirs::config_dir;
44
use reqwest;
55
use serde_json::{json, Value};
@@ -87,10 +87,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
8787

8888
loop {
8989
#[allow(deprecated)]
90-
let start =
91-
Utc::now().date().and_hms_opt(0, 0, 0).unwrap() - chrono::Duration::seconds(300);
92-
#[allow(deprecated)]
93-
let end = Utc::now().date().and_hms_opt(0, 0, 0).unwrap();
90+
let start = Local::now().to_utc() - chrono::Duration::minutes(5);
91+
let end = Local::now().to_utc();
9492
let timeperiods = vec![(start, end)];
9593

9694
let query_result = aw_client

0 commit comments

Comments
 (0)