change timestamp to iso8601
This commit is contained in:
parent
b23b5abe15
commit
715871dfbf
1 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import npyscreen
|
import npyscreen
|
||||||
import json
|
import json
|
||||||
from datetime import date
|
import datetime
|
||||||
import time
|
import time
|
||||||
from sys import argv
|
from sys import argv
|
||||||
|
|
||||||
|
@ -76,9 +76,9 @@ def main(*_args):
|
||||||
new_data['stammdaten'] = dict(zip(app.sd2.keys(), map(lambda f: f.value, app.sd2.values())))
|
new_data['stammdaten'] = dict(zip(app.sd2.keys(), map(lambda f: f.value, app.sd2.values())))
|
||||||
new_data['finanzdaten'] = dict(zip(app.fin2.keys(), map(lambda f: f.value, app.fin2.values())))
|
new_data['finanzdaten'] = dict(zip(app.fin2.keys(), map(lambda f: f.value, app.fin2.values())))
|
||||||
new_data['mitgliederdaten'] = dict(zip(app.mem2.keys(), map(lambda f: f.value, app.mem2.values())))
|
new_data['mitgliederdaten'] = dict(zip(app.mem2.keys(), map(lambda f: f.value, app.mem2.values())))
|
||||||
new_data['timestamp'] = f"{int(time.time())}"
|
new_data['timestamp'] = datetime.datetime.now().replace(microsecond=0).isoformat()
|
||||||
|
|
||||||
outfile_name = '{}_{}.json'.format(date.today().isoformat(), '_'.join(new_data['stammdaten']['fullname'].split()))
|
outfile_name = '{}_{}.json'.format(datetime.date.today().isoformat(), '_'.join(new_data['stammdaten']['fullname'].split()))
|
||||||
with open(outfile_name, 'w') as outfile:
|
with open(outfile_name, 'w') as outfile:
|
||||||
json.dump(new_data, outfile, sort_keys=True, indent=4)
|
json.dump(new_data, outfile, sort_keys=True, indent=4)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue