gear-orders/util.py
2026-03-06 18:33:08 -06:00

22 lines
487 B
Python

import aiohttp
import pytz
import datetime
from settings import TIMEZONE, ORDER_TIME
def make_session():
return aiohttp.ClientSession()
def timezone():
return pytz.timezone(TIMEZONE)
def sqlite_time(dt):
return dt.astimezone(datetime.UTC).strftime('%Y-%m-%d %H:%M:%S')
def order_time(str):
order_time_arr = list(map(int, str.split(':')))
return datetime.time(
hour=order_time_arr[0],
minute=order_time_arr[1],
tzinfo=timezone()
)