use timezone

This commit is contained in:
Mickael 2019-08-30 21:34:40 +02:00
parent 7b22c4d10d
commit 7190f7d0be

View file

@ -1,13 +1,14 @@
import os, json
import os, json, pytz
from datetime import datetime, timedelta
def main():
# I must add 2 hours on gitlab CI
nowongitlab = datetime.now() + timedelta(hours=2)
zone = ' '.join(pytz.country_timezones['fr'])
tz = pytz.timezone(zone)
now = datetime.now(tz)
info = {
"lastupdate": datetime.strftime(nowongitlab, "%d/%m/%Y %X")
"lastupdate": datetime.strftime(now, "%d/%m/%Y %X")
}
save(info)