Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Statusline: timezone is hardcoded to America/Los_Angeles instead of reading from settings.json

Open michaelaye opened this issue 9 months ago • 2 comments

Problem

The statusline-command.sh script has the timezone hardcoded to America/Los_Angeles in two places (the format_reset_time and clock_time functions):

local_dt = dt.astimezone(ZoneInfo('America/Los_Angeles'))

This means the 5h/7d usage reset times display in US Pacific time regardless of the user's location. For users outside the US, the reset times are confusing and don't match their local clock.

Expected Behavior

The script should read the timezone from settings.json where users already configure it:

"principal": {
  "timezone": "Europe/Berlin"
}

Suggested Fix

Read the timezone dynamically from settings.json and pass it into the Python snippets, falling back to the system timezone or UTC if not configured:

USER_TZ=$(jq -r '.principal.timezone // "UTC"' "$SETTINGS_FILE" 2>/dev/null)

Then use $USER_TZ instead of the hardcoded 'America/Los_Angeles' string in both Python blocks.

Ironically, line 596 already has a comment saying # Uses TZ from settings.json (principal.timezone) for correct local time — but the code below it doesn't actually do that.

Affected Lines

  • Line ~653 (format_reset_time function)
  • Line ~923 (clock_time function)

michaelaye avatar Feb 19 '26 01:02 michaelaye

Confirmed this bug on PAI v3.0 / WSL2. Fixed locally by reading the timezone from settings.json instead of hardcoding. The statusline now correctly reads principal.timezone from settings.

rikitikitavi2012-debug avatar Feb 22 '26 17:02 rikitikitavi2012-debug

Fixed in v4.0.1 — the statusline now reads principal.timezone from settings.json instead of hardcoding America/Los_Angeles. Thanks for reporting this.

👉 Releases page

kaimagnus avatar Mar 01 '26 01:03 kaimagnus