Browse Source

改个东8区时间

DESKTOP-NE65RNK\Citrus_limon 1 year ago
parent
commit
848f6499b6
2 changed files with 3 additions and 3 deletions
  1. 2 2
      src/export/html.rs
  2. 1 1
      src/main.rs

+ 2 - 2
src/export/html.rs

@@ -27,8 +27,8 @@ pub fn export_html(export_info: Vec<ExportExchangeTickerInfo>, symbol: &str, sta
         name_list.push(format!("'{}'", exchange_info.name));
     }
 
-    let start_time_d = Decimal::from_str(start_at).unwrap() * dec!(1000);
-    let end_time_d = Decimal::from_str(end_at).unwrap() * dec!(1000);
+    let start_time_d = Decimal::from_str(start_at).unwrap() * dec!(1000) + dec!(8) * dec!(3600000);
+    let end_time_d = Decimal::from_str(end_at).unwrap() * dec!(1000) + dec!(8) * dec!(3600000);
     let start_time = NaiveDateTime::from_timestamp_millis(start_time_d.to_i64().unwrap()).unwrap().format("%Y-%m-%d %H:%M:%S%.3f").to_string();
     let end_time = NaiveDateTime::from_timestamp_millis(end_time_d.to_i64().unwrap()).unwrap().format("%Y-%m-%d %H:%M:%S%.3f").to_string();
 

+ 1 - 1
src/main.rs

@@ -1,4 +1,4 @@
-use chrono::{DateTime, NaiveDateTime, TimeZone, Utc};
+use chrono::{NaiveDateTime};
 use tracing::{error, info};
 use crate::export::html::ExportExchangeTickerInfo;
 use crate::utils::logs;