portail/scripts/generate_global_info.py
2022-07-18 17:13:30 +08:00

17 lines
No EOL
371 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, "site/data/global")
if __name__ == "__main__":
main()