27 lines
601 B
Python
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
|