From 9d58a6143086ffdca892da137d31510d243c33ff Mon Sep 17 00:00:00 2001 From: xtaodada Date: Thu, 25 May 2023 17:37:27 +0800 Subject: [PATCH] fix utc+8 time --- defs/glover.py.example | 6 ++++++ defs/models.py | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 defs/glover.py.example diff --git a/defs/glover.py.example b/defs/glover.py.example new file mode 100644 index 0000000..a03d657 --- /dev/null +++ b/defs/glover.py.example @@ -0,0 +1,6 @@ +api_id = 1 +api_hash = "a" +rss_hub_host = "https://rsshub.app" +cid = 11 +tid = None +owner = 11 diff --git a/defs/models.py b/defs/models.py index 15329bc..b963f10 100644 --- a/defs/models.py +++ b/defs/models.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime, timedelta from typing import List from pydantic import BaseModel @@ -16,7 +16,8 @@ class Tweet(BaseModel): @property def time_str(self) -> str: - return self.time.strftime("%Y-%m-%d %H:%M:%S") + utc_8_time = self.time + timedelta(hours=8) + return utc_8_time.strftime("%Y-%m-%d %H:%M:%S") class User(BaseModel):