initial commit

This commit is contained in:
Hirad 2024-12-01 14:45:50 +03:30
parent da3e006c80
commit 5a5881832b
3 changed files with 14 additions and 0 deletions

0
utils/__init__.py Normal file
View file

7
utils/date_converter.py Normal file
View file

@ -0,0 +1,7 @@
import datetime
def datetime_from_timestamp(timestamp):
dt_object = datetime.datetime.fromtimestamp(timestamp)
formatted_datetime = dt_object.strftime('%Y-%m-%d %H:%M:%S')
return formatted_datetime

View file

@ -0,0 +1,7 @@
def endpoint_id_to_name_converter(endpoints, endpoint_id):
for endpoint in endpoints:
if endpoint['id'] == endpoint_id:
return endpoint['name']
return "Unknown endpoint"