fix utc+8 time

This commit is contained in:
xtaodada 2023-05-25 17:37:27 +08:00
parent cd6c283426
commit 9d58a61430
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
2 changed files with 9 additions and 2 deletions

6
defs/glover.py.example Normal file
View File

@ -0,0 +1,6 @@
api_id = 1
api_hash = "a"
rss_hub_host = "https://rsshub.app"
cid = 11
tid = None
owner = 11

View File

@ -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):