Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agent_cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from datetime import datetime
from datetime import UTC, datetime
from pathlib import Path

import typer
Expand Down Expand Up @@ -77,7 +77,7 @@ async def run(

# Setup transcript path (always write transcript)
if transcript is None:
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
timestamp = datetime.now(tz=UTC).strftime("%Y%m%d_%H%M%S")
transcript = Path(f"/tmp/adgn-agent-transcript-{timestamp}.jsonl")
console.print(f"[dim]Writing transcript to: {transcript}[/dim]")

Expand Down
2 changes: 1 addition & 1 deletion cluster/k8s/inventree/token-provisioner/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def needs_renewal(token: dict) -> bool:
print("Token has no expiry — skipping renewal.")
return False
expiry = datetime.date.fromisoformat(expiry_str)
days_remaining = (expiry - datetime.date.today()).days
days_remaining = (expiry - datetime.datetime.now(tz=datetime.UTC).date()).days
print(f"Token '{TOKEN_NAME}' expires {expiry_str} ({days_remaining} days remaining).")
return days_remaining < RENEW_DAYS_BEFORE

Expand Down
2 changes: 1 addition & 1 deletion debug/spice_lag/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _cache_path(frame_file: Path) -> Path:
def _parse_clock(clock_str: str) -> datetime.datetime:
"""Parse HH:MM:SS.mmm clock string."""
padded = clock_str + "000" if len(clock_str.rsplit(".", maxsplit=1)[-1]) == 3 else clock_str
return datetime.datetime.strptime(padded, "%H:%M:%S.%f")
return datetime.datetime.strptime(padded, "%H:%M:%S.%f").replace(tzinfo=datetime.UTC)


def analyze_pixeldiff(
Expand Down
2 changes: 1 addition & 1 deletion debug/spice_lag/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def stop_screencast(bus: Gio.DBusConnection) -> None:

def _now_str() -> str:
"""Current wall-clock time as HH:MM:SS.mmm."""
now = datetime.datetime.now()
now = datetime.datetime.now(tz=datetime.UTC)
return now.strftime("%H:%M:%S.") + f"{now.microsecond // 1000:03d}"


Expand Down
4 changes: 2 additions & 2 deletions devinfra/claude/hook_daemon/session_start/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import logging
import logging.handlers
from dataclasses import dataclass
from datetime import datetime
from datetime import UTC, datetime
from pathlib import Path

import anyio
Expand Down Expand Up @@ -529,7 +529,7 @@ async def run_session(
bazelisk.install_wrapper(paths)

# Generate timestamp
hook_timestamp = datetime.now()
hook_timestamp = datetime.now(tz=UTC)
timestamp_file = paths.session_dir / "session-hook-last-run"
timestamp_file.write_text(f"{hook_timestamp.isoformat()}\n")
logger.info("Session start hook timestamp: %s", hook_timestamp.isoformat())
Expand Down
8 changes: 6 additions & 2 deletions finance/reconcile/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def add_external_to_gnucash(external_transaction, book, account_of_interest, ext
currency = book.get_table().lookup("ISO4217", "CHF")
tx.SetCurrency(currency)
tx.SetDescription(external_transaction.description)
tx.SetNotes(f"Imported at {datetime.datetime.now()}")
tx.SetNotes(f"Imported at {datetime.datetime.now(tz=datetime.UTC)}")

split_in_splitwise = gnucash.Split(book)
split_in_splitwise.SetParent(tx)
Expand Down Expand Up @@ -162,7 +162,11 @@ def main(_):

# 'start_date' sets date at which mapping starts
if "start_date" in reconcile_config:
start_date = datetime.datetime.strptime(reconcile_config["start_date"], "%Y-%m-%d").date()
start_date = (
datetime.datetime.strptime(reconcile_config["start_date"], "%Y-%m-%d")
.replace(tzinfo=datetime.UTC)
.date()
)

external_transaction_by_external_id = {
external_id: external_transaction
Expand Down
2 changes: 1 addition & 1 deletion finance/reconcile/splitwise_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def load_splitwise_expenses(splitwise_group_id) -> dict[str, external_system.Ext
# We are not involved.
continue

dt = datetime.datetime.strptime(expense.date, "%Y-%m-%dT%H:%M:%SZ").date()
dt = datetime.datetime.strptime(expense.date, "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=datetime.UTC).date()
expenses[str(expense.id)] = external_system.ExternalExpense(
id=str(expense.id),
description=((expense.description or "") + (expense.notes or "")),
Expand Down
Loading
Loading