Skip to content

Commit

Permalink
feat(yanic-import-timestamp): allow importing from other yanic instan…
Browse files Browse the repository at this point in the history
…ce (#223)

This fixes an issue when an import from other yanic is needed.

The datetime can have different timezones with yanic_date_format.
The latest yanic format is now used as a fallback if the millisecond format from hopglass is not present.
  • Loading branch information
maurerle authored Sep 11, 2023
1 parent f0afece commit 5a8383e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/yanic-import-timestamp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ with open(yanic_db_path, encoding='UTF-8') as handle:

total = 0
updated = 0
yanic_date_format = '%Y-%m-%dT%H:%M:%S+0000'
yanic_date_format = '%Y-%m-%dT%H:%M:%S%z'
v1_date_format = '%Y-%m-%dT%H:%M:%S.%f' # 2017-05-31T18:30:19.759610
v2_date_format = '%Y-%m-%dT%H:%M:%S.%fZ' # 2015-08-22T16:05:02.000Z
version = legacy_db['version']
Expand All @@ -39,7 +39,7 @@ if version == 1:
legacy_date_format = v1_date_format # ffmap-backend
elif version == 2:
legacy_date_format = v2_date_format # hopglass
fallback_date_format = v1_date_format # ffmap-backend
fallback_date_format = yanic_date_format # other yanic
else:
print('unhandled nodes.json version number!', file=sys.stderr)
sys.exit(1)
Expand Down

0 comments on commit 5a8383e

Please sign in to comment.