diff --git a/scripts/add_new_contribution_to_yaml.py b/scripts/add_new_contribution_to_yaml.py index cda956a..99505ff 100644 --- a/scripts/add_new_contribution_to_yaml.py +++ b/scripts/add_new_contribution_to_yaml.py @@ -1,6 +1,7 @@ """ given properties, add a new contribution to the contributions.yaml database file. """ +from datetime import datetime import json from sys import argv @@ -37,9 +38,11 @@ # append new contribution with next index # add status, at top + datetime_today = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z') contribution = { 'id': max_index + 1, 'status': 'VALID', + 'date_added': datetime_today, } contribution.update(props) diff --git a/scripts/fetch_updates.py b/scripts/fetch_updates.py index 38eb848..f818cef 100644 --- a/scripts/fetch_updates.py +++ b/scripts/fetch_updates.py @@ -9,6 +9,9 @@ def update_contribution(contribution, props): + datetime_today = datetime.utcnow().strftime('%Y-%m-%dT%H:%M:%S%z') + contribution['last_updated'] = datetime_today + # update from online for field in props.keys(): # process category list @@ -31,7 +34,7 @@ def log_broken(contribution, msg): contribution['log'].append(msg) def process_contribution(contribution): - date_today = datetime.today().strftime('%Y-%m-%d') + date_today = datetime.utcnow().strftime('%Y-%m-%d') this_version = '0' if contribution['status'] != 'DEPRECATED':