diff options
Diffstat (limited to 'packages/meshbay-cli/src/meshbay_cli/commands/groups.py')
| -rw-r--r-- | packages/meshbay-cli/src/meshbay_cli/commands/groups.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/meshbay-cli/src/meshbay_cli/commands/groups.py b/packages/meshbay-cli/src/meshbay_cli/commands/groups.py index 04395dd..5ee1356 100644 --- a/packages/meshbay-cli/src/meshbay_cli/commands/groups.py +++ b/packages/meshbay-cli/src/meshbay_cli/commands/groups.py @@ -10,7 +10,7 @@ operator is another notion. import contextlib import json import sys -from datetime import datetime +from datetime import UTC, datetime from ..client.groups import my_groups from ..client.hub import HubError @@ -38,9 +38,12 @@ def local_time(iso: str | None) -> str: if not iso: return "" try: - return datetime.fromisoformat(iso).astimezone().strftime("%Y-%m-%d %H:%M") + moment = datetime.fromisoformat(iso) except ValueError: return "" + if moment.tzinfo is None: # a hub on SQLite sends UTC without saying so + moment = moment.replace(tzinfo=UTC) + return moment.astimezone().strftime("%Y-%m-%d %H:%M") async def run(ctx: Context) -> int: |