Generateurv2/backend/api/room/utils.py
2022-05-18 10:15:54 +02:00

27 lines
601 B
Python

from datetime import datetime
import pytz
def getNow():
now = datetime.now()
now = now.astimezone(pytz.timezone('Europe/Berlin'))
days = {
'Monday': 'Lundi',
'Tuesday': 'Mardi',
'Wednesday': 'Mercredi',
'Thursday': 'Jeudi',
'Friday': 'Vendredi',
'Saturday': "Samedi",
"Sunday": "Dimanche"
}
date = {
'day': str(now.day),
'month': str(now.month),
'year': str(now.year),
'hours': str(now.hour),
'minutes': str(now.minute),
'secondes': str(now.second),
'day_name': days[now.strftime('%A')]
}
return date