diff options
author | figsoda <figsoda@pm.me> | 2023-11-15 22:05:52 -0500 |
---|---|---|
committer | figsoda <figsoda@pm.me> | 2023-11-15 22:23:30 -0500 |
commit | 7805a7a88fd0fb13b4bedc22e08a11f705cb24ce (patch) | |
tree | 2b9e26820ccbc658c17a0a7903d0d438fe2075b3 | |
parent | eb491233cd74eb8a3642ca459ab672390ed02222 (diff) | |
download | nixlib-7805a7a88fd0fb13b4bedc22e08a11f705cb24ce.tar nixlib-7805a7a88fd0fb13b4bedc22e08a11f705cb24ce.tar.gz nixlib-7805a7a88fd0fb13b4bedc22e08a11f705cb24ce.tar.bz2 nixlib-7805a7a88fd0fb13b4bedc22e08a11f705cb24ce.tar.lz nixlib-7805a7a88fd0fb13b4bedc22e08a11f705cb24ce.tar.xz nixlib-7805a7a88fd0fb13b4bedc22e08a11f705cb24ce.tar.zst nixlib-7805a7a88fd0fb13b4bedc22e08a11f705cb24ce.zip |
pluginupdate.py: format date differently
- use %Y-%m%d - use UTC instead of local time
-rw-r--r-- | maintainers/scripts/pluginupdate.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/maintainers/scripts/pluginupdate.py b/maintainers/scripts/pluginupdate.py index 44a445875d91..cc0f4ef742d1 100644 --- a/maintainers/scripts/pluginupdate.py +++ b/maintainers/scripts/pluginupdate.py @@ -26,7 +26,7 @@ import urllib.parse import urllib.request import xml.etree.ElementTree as ET from dataclasses import asdict, dataclass -from datetime import datetime +from datetime import UTC, datetime from functools import wraps from multiprocessing.dummy import Pool from pathlib import Path @@ -788,14 +788,12 @@ def update_plugins(editor: Editor, args): autocommit = not args.no_commit if autocommit: - from datetime import date - try: repo = git.Repo(os.getcwd()) - updated = date.today().strftime('%m-%d-%Y') + updated = datetime.now(tz=UTC).strftime('%Y-%m-%d') print(args.outfile) commit(repo, - f"{editor.attr_path}: updated the {updated}", [args.outfile] + f"{editor.attr_path}: update on {updated}", [args.outfile] ) except git.InvalidGitRepositoryError as e: print(f"Not in a git repository: {e}", file=sys.stderr) |