change timezone utc to jst

This commit is contained in:
wakamezake
2020-11-15 11:29:12 +09:00
parent 6b58c9bcf5
commit d3c34086ff

View File

@@ -1,4 +1,4 @@
from datetime import datetime from datetime import datetime, timedelta, timezone
class Author: class Author:
@@ -90,7 +90,8 @@ class BaseRenderer:
self.chat.author.badgeUrl = badge["liveChatAuthorBadgeRenderer"]["customThumbnail"]["thumbnails"][0]["url"] self.chat.author.badgeUrl = badge["liveChatAuthorBadgeRenderer"]["customThumbnail"]["thumbnails"][0]["url"]
def get_datetime(self, timestamp): def get_datetime(self, timestamp):
dt = datetime.fromtimestamp(timestamp / 1000000) jst = timezone(timedelta(hours=9))
dt = datetime.fromtimestamp(timestamp / 1000000, jst)
return dt.strftime('%Y-%m-%d %H:%M:%S') return dt.strftime('%Y-%m-%d %H:%M:%S')
def get_chatobj(self): def get_chatobj(self):