22 lines
475 B
Python
22 lines
475 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 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()
|
|
)
|