mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-25 20:56:30 +00:00
sendat Read timezone from config (#122)
This commit is contained in:
parent
863b7bd474
commit
6889ad6bca
@ -5,6 +5,7 @@ import pytz
|
|||||||
from typing import Optional, List
|
from typing import Optional, List
|
||||||
|
|
||||||
from pagermaid import bot
|
from pagermaid import bot
|
||||||
|
from pagermaid.config import Config
|
||||||
from pagermaid.listener import listener
|
from pagermaid.listener import listener
|
||||||
from pagermaid.scheduler import scheduler
|
from pagermaid.scheduler import scheduler
|
||||||
from pagermaid.single_utils import sqlite, Message
|
from pagermaid.single_utils import sqlite, Message
|
||||||
@ -212,7 +213,7 @@ class SendTasks:
|
|||||||
args=[task, self])
|
args=[task, self])
|
||||||
|
|
||||||
def register_date_task(self, task: SendTask):
|
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))
|
date_will = date_now.replace(hour=int(task.hour), minute=int(task.minute), second=int(task.second))
|
||||||
if date_will < date_now:
|
if date_will < date_now:
|
||||||
date_will += datetime.timedelta(days=1)
|
date_will += datetime.timedelta(days=1)
|
||||||
|
Loading…
Reference in New Issue
Block a user