portail/scripts/generate_global_info.py
2019-09-01 13:12:30 +02:00

17 lines
No EOL
361 B
Python

import os, json, pytz
from datetime import datetime, timedelta
from common.savehelper import save
def main():
zone = ' '.join(pytz.country_timezones['fr'])
tz = pytz.timezone(zone)
now = datetime.now(tz)
info = {
"lastupdate": datetime.strftime(now, "%d/%m/%Y %X")
}
save(info, "global")
if __name__ == "__main__":
main()