use timezone
This commit is contained in:
parent
7b22c4d10d
commit
7190f7d0be
1 changed files with 5 additions and 4 deletions
|
@ -1,13 +1,14 @@
|
||||||
import os, json
|
import os, json, pytz
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
# I must add 2 hours on gitlab CI
|
zone = ' '.join(pytz.country_timezones['fr'])
|
||||||
nowongitlab = datetime.now() + timedelta(hours=2)
|
tz = pytz.timezone(zone)
|
||||||
|
now = datetime.now(tz)
|
||||||
|
|
||||||
info = {
|
info = {
|
||||||
"lastupdate": datetime.strftime(nowongitlab, "%d/%m/%Y %X")
|
"lastupdate": datetime.strftime(now, "%d/%m/%Y %X")
|
||||||
}
|
}
|
||||||
save(info)
|
save(info)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue