From 6889ad6bca475c39fda0744d5080787e53d8d937 Mon Sep 17 00:00:00 2001 From: Godlike <26649232+godlikeanyone@users.noreply.github.com> Date: Mon, 23 Jan 2023 09:30:52 -0500 Subject: [PATCH] sendat Read timezone from config (#122) --- sendat/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sendat/main.py b/sendat/main.py index 5cfcba7..60f0949 100644 --- a/sendat/main.py +++ b/sendat/main.py @@ -5,6 +5,7 @@ import pytz from typing import Optional, List from pagermaid import bot +from pagermaid.config import Config from pagermaid.listener import listener from pagermaid.scheduler import scheduler from pagermaid.single_utils import sqlite, Message @@ -212,7 +213,7 @@ class SendTasks: args=[task, self]) def register_date_task(self, task: SendTask): - date_now = datetime.datetime.now(pytz.timezone("Asia/Shanghai")) + date_now = datetime.datetime.now(pytz.timezone(Config.TIME_ZONE)) date_will = date_now.replace(hour=int(task.hour), minute=int(task.minute), second=int(task.second)) if date_will < date_now: date_will += datetime.timedelta(days=1)