From 2fdbb94c28809e45b4e984b4562b3b9a41a4b6ac Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Mon, 28 Jul 2025 00:22:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=97=B6=E9=97=B4=E6=88=B3?= =?UTF-8?q?=E5=A4=84=E7=90=86=EF=BC=8C=E4=BD=BF=E7=94=A8=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=97=B6=E5=8C=BA=E8=BD=AC=E6=8D=A2=E4=BB=A5=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index e1c8f62..7e38b03 100644 --- a/main.py +++ b/main.py @@ -3,7 +3,7 @@ import json import time import subprocess -from datetime import datetime, timezone +from datetime import datetime from collections import defaultdict import logging from pathlib import Path @@ -70,9 +70,8 @@ def calculate_daily_stats(transactions): ) for tx in transactions: - date = datetime.fromtimestamp(tx["blockTimestamp"], timezone.utc).strftime( - "%Y-%m-%d" - ) + # 使用本地时区转换时间戳 + date = datetime.fromtimestamp(tx["blockTimestamp"]).strftime("%Y-%m-%d") price = tx.get("price", 0) tokens_sold = tx.get("tokensSold", 0)