[GH-ISSUE #5767] [BUG]: {time} uses a 12-hour AM/PM format while my system is configured to use a 24-hour format. #5562

Closed
opened 2026-06-07 16:36:40 -04:00 by yindo · 1 comment
Owner

Originally created by @LeDimigit on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5767

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

When I use {time} in my system prompt and ask my agent what time it is, I expect the returned time to match my system's time format, but {time} is returned using a 12-hour AM/PM format, which does not match the configured system time format.

Are there known steps to reproduce?

  1. Configure the system time format to use a format other than AM/PM (e.g. 24-hour format).
  2. Use {time} in the system prompt.
  3. Start a conversation and ask: "What time is it?"

LLM Provider & Model (if applicable)

LM Studio

Embedder Provider & Model (if applicable)

No response

Originally created by @LeDimigit on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/5767 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? When I use {time} in my system prompt and ask my agent what time it is, I expect the returned time to match my system's time format, but {time} is returned using a 12-hour AM/PM format, which does not match the configured system time format. ### Are there known steps to reproduce? 1. Configure the system time format to use a format other than AM/PM (e.g. 24-hour format). 2. Use {time} in the system prompt. 3. Start a conversation and ask: "What time is it?" ### LLM Provider & Model (if applicable) LM Studio ### Embedder Provider & Model (if applicable) _No response_
yindo added the possible bug label 2026-06-07 16:36:40 -04:00
yindo closed this issue 2026-06-07 16:36:40 -04:00
Author
Owner

@timothycarambat commented on GitHub (Jun 6, 2026):

There's no reliable, cross-platform way for a Node.js process to detect whether you have configured their OS for 12-hour vs 24-hour time. The OS locale (e.g. en_US) doesn't encode that preference - it's a separate system setting that lives in different places on each platform (macOS AppleICUForce24HourTime, Windows registry, Linux desktop environment settings, etc.) There's really nothing to key off of here to know this prefernce aside from adding a {time_24} var instead of {time} for system variables

<!-- gh-comment-id:4640175279 --> @timothycarambat commented on GitHub (Jun 6, 2026): There's no reliable, cross-platform way for a Node.js process to detect whether you have configured their OS for 12-hour vs 24-hour time. The OS locale (e.g. en_US) doesn't encode that preference - it's a separate system setting that lives in different places on each platform (macOS AppleICUForce24HourTime, Windows registry, Linux desktop environment settings, etc.) There's really nothing to key off of here to know this prefernce aside from adding a {time_24} var instead of {time} for system variables
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#5562