From e9bd0b122e6ed85b14364f0fe6ff04d40062e411 Mon Sep 17 00:00:00 2001 From: apkallum Date: Mon, 10 Aug 2020 19:17:17 -0400 Subject: [PATCH 1/2] fix: utc timing for initial command log as well --- archivebox/logging_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archivebox/logging_util.py b/archivebox/logging_util.py index 684f3d80..50b639eb 100644 --- a/archivebox/logging_util.py +++ b/archivebox/logging_util.py @@ -164,7 +164,7 @@ def log_cli_command(subcommand: str, subcommand_args: List[str], stdin: Optional cmd = ' '.join(('archivebox', subcommand, *subcommand_args)) stdin_hint = ' < /dev/stdin' if not stdin.isatty() else '' stderr('{black}[i] [{now}] ArchiveBox v{VERSION}: {cmd}{stdin_hint}{reset}'.format( - now=datetime.now().strftime('%Y-%m-%d %H:%M:%S'), + now=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S'), VERSION=VERSION, cmd=cmd, stdin_hint=stdin_hint, From 50069d1eb334b5df0b7081e0b6b96c358d8f9667 Mon Sep 17 00:00:00 2001 From: apkallum Date: Mon, 10 Aug 2020 23:21:02 -0400 Subject: [PATCH 2/2] set tz variable globally as UTC --- archivebox/config/__init__.py | 3 +++ archivebox/logging_util.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/archivebox/config/__init__.py b/archivebox/config/__init__.py index e70c2fb0..c53c5eec 100644 --- a/archivebox/config/__init__.py +++ b/archivebox/config/__init__.py @@ -738,6 +738,9 @@ def load_all_config(): CONFIG = load_all_config() globals().update(CONFIG) +# Timezone set as UTC +os.environ["TZ"] = 'UTC' + ############################## Importable Checkers ############################# diff --git a/archivebox/logging_util.py b/archivebox/logging_util.py index 50b639eb..684f3d80 100644 --- a/archivebox/logging_util.py +++ b/archivebox/logging_util.py @@ -164,7 +164,7 @@ def log_cli_command(subcommand: str, subcommand_args: List[str], stdin: Optional cmd = ' '.join(('archivebox', subcommand, *subcommand_args)) stdin_hint = ' < /dev/stdin' if not stdin.isatty() else '' stderr('{black}[i] [{now}] ArchiveBox v{VERSION}: {cmd}{stdin_hint}{reset}'.format( - now=datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S'), + now=datetime.now().strftime('%Y-%m-%d %H:%M:%S'), VERSION=VERSION, cmd=cmd, stdin_hint=stdin_hint,