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
|
||||
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue