get actual time

This commit is contained in:
Mylloon 2021-06-03 12:22:41 +02:00
parent d0feaf53be
commit 99765c7b9e

View file

@ -2,9 +2,12 @@ import re
import json
import requests
import time
import os
from pytz import timezone
from datetime import datetime
myTimezone = os.environ['TIMEZONE']
def goodTimezone(date, type, tz):
"""renvoie une date en fonction d'un timezone"""
if type == 0:
@ -176,3 +179,6 @@ def stringTempsVersSecondes(time):
remindertime += int(tempsEnSeconde) * int(i[0])
return remindertime
def nowTimestamp():
return datetime.now(timezone(myTimezone)).timestamp()