get actual time
This commit is contained in:
parent
d0feaf53be
commit
99765c7b9e
1 changed files with 6 additions and 0 deletions
|
@ -2,9 +2,12 @@ import re
|
||||||
import json
|
import json
|
||||||
import requests
|
import requests
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
from pytz import timezone
|
from pytz import timezone
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
myTimezone = os.environ['TIMEZONE']
|
||||||
|
|
||||||
def goodTimezone(date, type, tz):
|
def goodTimezone(date, type, tz):
|
||||||
"""renvoie une date en fonction d'un timezone"""
|
"""renvoie une date en fonction d'un timezone"""
|
||||||
if type == 0:
|
if type == 0:
|
||||||
|
@ -176,3 +179,6 @@ def stringTempsVersSecondes(time):
|
||||||
remindertime += int(tempsEnSeconde) * int(i[0])
|
remindertime += int(tempsEnSeconde) * int(i[0])
|
||||||
|
|
||||||
return remindertime
|
return remindertime
|
||||||
|
|
||||||
|
def nowTimestamp():
|
||||||
|
return datetime.now(timezone(myTimezone)).timestamp()
|
||||||
|
|
Reference in a new issue