[FEATURE] Support LC_TIME locale for /usage command time formatting

Status Open
Reported on v2.1.2
Maintainer reply None cached
Activity 8 comments · opened Jun 18, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The /usage command currently displays times in 12-hour format (e.g., "5am", "6pm") regardless of the system's LC_TIME locale setting.

Current Behavior

Current session
██████████████████████████████████▌   69% used
Resets 5am (Europe/Saratov)

Current week (all models)
███████████████████████████████████████████▌   87% used
Resets 6pm (Europe/Saratov)

Expected Behavior

When LC_TIME=en_GB.UTF-8 (or other locales that use 24-hour format) is set, the times should be displayed in 24-hour format:

Current session
██████████████████████████████████▌   69% used
Resets 05:00 (Europe/Saratov)

Current week (all models)
███████████████████████████████████████████▌   87% used
Resets 18:00 (Europe/Saratov)

Environment

  • OS: Linux (WSL2)
  • Claude CLI version: 2.1.2, still exists in 2.1.178
  • LC_TIME is properly set in environment: LC_TIME=en_GB.UTF-8
  • System locale is configured and generated: locale-gen en_GB.UTF-8

Steps to Reproduce

  1. Set export LC_TIME=en_GB.UTF-8 in .bashrc
  2. Generate locale: sudo locale-gen en_GB.UTF-8
  3. Verify locale is active: locale | grep LC_TIME shows LC_TIME=en_GB.UTF-8
  4. Launch Claude CLI
  5. Run /usage command
  6. Observe that time is still shown in 12-hour format (5am, 6pm) instead of 24-hour format (05:00, 18:00)

Additional Context

Many international users prefer 24-hour time format, which is the standard in most countries outside the US. Respecting the LC_TIME locale would make the CLI experience more localized and user-friendly.

Originally reported in #20675 by @errordnk

Proposed Solution

Respect the system's LC_TIME locale setting when formatting timestamps in the /usage command output. This would make Claude CLI more internationally friendly and consistent with user expectations based on their locale settings.

@lfarkas found:
★ Insight ─────────────────────────────────────
JavaScript locale-aware time formatting: In JS, toLocaleTimeString() without arguments should respect the runtime's locale. However, if hour12: true is explicitly passed as an option, it overrides the locale and
forces AM/PM. The fix is to either omit hour12 entirely or use undefined as the locale parameter, which tells the runtime to use the system's LANG/LC_TIME environment variables. In Node.js/Bun, ICU data
availability also matters — some minimal builds don't include full locale data.
─────────────────────────────────────────────────

Here's what I found:

Location: The time formatting code is in the compiled Claude Code binary (~/.local/share/claude/versions/2.1.44), not in this repository. This repo contains plugins, scripts, and docs but not the main CLI
source.

Root cause: The /usage command's "Last updated" time uses toLocaleTimeString() with what appears to be a hardcoded hour12 option, forcing 12-hour AM/PM format regardless of your LC_TIME setting.

Fix: The source code would need to stop hardcoding hour12: true and let the locale determine the format.

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

View original on GitHub ↗

4 Comments

github-actions[bot] · 2 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/20675
  2. https://github.com/anthropics/claude-code/issues/52214

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

AzarAI-TOP · 2 months ago

Confirming this is still unresolved on 2.1.183, and adding concrete evidence from the compiled binary.

This isn't just the hour12 flag — the locale itself is hardcoded as a string literal. Grepping the shipped CLI (~/.local/share/claude/versions/2.1.x), every call that renders these times passes "en-US" explicitly:

_.toLocaleTimeString("en-US", { hour: "numeric", minute: ... })
new Date(...).toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" })
...toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: !0 })

Two consequences:

  1. en-US defaults to 12-hour, and some call sites additionally hardcode hour12: true (minified to hour12:!0).
  2. Because the locale is passed as a literal argument, no environment setting can override it — LC_TIME=en_GB.UTF-8, LANG, etc. are all ignored, since toLocaleTimeString("en-US", …) disregards the runtime/system locale entirely.

So this can't be worked around by users; it has to be fixed in source. Two options:

  • Minimal fix: replace the hardcoded "en-US" with undefined (and drop the hardcoded hour12) so the system locale is respected, or
  • Better: add an explicit time-format preference (12h/24h) in settings.json, which doesn't depend on the user having a locale generated.

Please keep this open — the bot flagged it for auto-closure, but it's a real, still-reproducing request.

JeffreyS80 · 1 month ago

Adding a data point from a non-US, non-Linux user: I'm in the Netherlands and use 24-hour time exclusively, AM/PM isn't natural for me at all. This isn't just a Linux/LC_TIME case. I hit it on the Claude Code Windows desktop app, where Windows already has a 24-hour locale set system-wide that Claude Code ignores. So the scope is broader than the original repro suggests: respecting the OS locale (LC_TIME on *nix, the regional format setting on Windows) would cover all platforms, or alternatively a simple timeFormat: "12h" | "24h" setting in settings.json. Either works for me. Glad to see this reopened, would love to see it land. 🙂

FoxKyong · 1 month ago

The same here. I am using linux and it is also not natural for me as we use 24-hour format here.

Showing cached comments. Read the full discussion on GitHub ↗