gear-orders/util.py
2026-03-08 13:44:59 -05:00

25 lines
540 B
Python

import aiohttp
import pytz
import datetime
from settings import TIMEZONE
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 time_sqlite(dt):
return dt.replace(tzinfo=datetime.UTC)
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()
)