Skip to content

Include day of week in date/time context injection #4629

@apiekar

Description

@apiekar

Problem

The current date/time injection in the system prompt only includes the timezone:

return ["## Current Date & Time", `Time zone: ${params.userTimezone}`, ""];

This means the agent has to infer the date from message timestamps or run date to verify. This frequently leads to errors where the agent states the wrong day of the week — a common issue across LLMs.

Proposed Solution

Include the full date with day of week in the injection:

return [
  "## Current Date & Time",
  `${new Date().toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', timeZone: params.userTimezone })}`,
  `Time zone: ${params.userTimezone}`,
  ""
];

This would produce something like:

## Current Date & Time
Friday, January 30, 2026
Time zone: America/New_York

Why This Matters

  • Agents frequently get the day of week wrong when users ask
  • Simple fix that benefits all users
  • Removes need for agents to verify with date command
  • Makes briefings and scheduling more reliable

Happy to submit a PR if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions