Вторая часть: Небольшие дополнения и структура

This commit is contained in:
Verum
2025-02-22 08:49:55 +07:00
parent 075a610728
commit 3dcd49a3cc
28 changed files with 435 additions and 34 deletions

View File

@@ -0,0 +1,23 @@
# BotLibrary/timer/start_time.py
# Получение времени по
import pytz
from datetime import datetime
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from ProjectsFiles import BotVar
# Функция получение времени по Московскому времени
def get_moscow_time():
moscow_tz = pytz.timezone('Europe/Moscow')
moscow_time = datetime.now(moscow_tz)
return moscow_time.strftime(BotVar.time_format)
# Функция получение времени хоста
def get_host_time():
host_time = datetime.now()
return host_time.strftime(BotVar.time_format)
# Создание планировщика
scheduler = AsyncIOScheduler(timezone=get_moscow_time())