Current Datetime
Inject the current date and time into each request so the LLM has accurate temporal context.
Current Datetime injects the current date and time into each request before it is forwarded to the LLM. This gives the model reliable temporal context for queries that depend on knowing the current date or time — for example: "What happened today?", "How many business days are left this month?", or "What should I schedule for tomorrow?"
Without this module, LLMs have no knowledge of the current date beyond their training cutoff, often producing incorrect or vague temporal answers.
Stage
| Stage | Behavior |
|---|---|
| PRE only | Appends a datetime block as a suffix to the latest user message before forwarding to the LLM |
Injected Format
The module appends the following block to the last user message in the request:
{original user message}
Timezone: {timezone}
Current datetime: {datetime}If no user message exists in the request, the block is appended to the last message of any role.
Example
Original user message:
How many days until the end of the quarter?After injection (timezone: Asia/Jakarta, format: ISO 8601):
How many days until the end of the quarter?
Timezone: Asia/Jakarta
Current datetime: 2026-06-25T09:30:00+07:00Prompt Caching Optimization
Optimized for Prompt Caching
The datetime block is appended as a suffix to the latest user message rather than prepended to the beginning of the prompt.
Because modern LLM providers (Anthropic, OpenAI, DeepSeek, vLLM, Gemini) use prefix-based KV-caching, appending the dynamic timestamp at the tail ensures that the entire static prefix—including system prompts, tool definitions, and prior conversation history—remains 100% cacheable, saving 50–90% in token costs and drastically reducing Time to First Token (TTFT).
Configuration
Timezone
The IANA timezone identifier used to resolve the current datetime. Defaults to UTC.
All standard IANA timezone identifiers are supported. If an unknown or invalid timezone is provided, the module automatically falls back to UTC.
Common options:
| Region | Value |
|---|---|
| UTC | UTC |
| Jakarta / Bangkok / Ho Chi Minh | Asia/Jakarta |
| Singapore / Kuala Lumpur | Asia/Singapore |
| Tokyo | Asia/Tokyo |
| London | Europe/London |
| New York | America/New_York |
| Los Angeles | America/Los_Angeles |
Datetime Format
The output format for the injected datetime string.
| Option | Example Output |
|---|---|
| ISO 8601 (default) | 2026-06-18T21:30:00+07:00 |
| Date only | 2026-06-18 |
| Date & time | 2026-06-18 21:30:00 |
| Human readable | June 18, 2026 21:30 WIB |
| Unix timestamp | 1781814600 |
Example Use Cases
- Time-sensitive Q&A bots: Chatbots that answer questions like "What's today?" or "When does this promotion end?" need reliable temporal context.
- Scheduling assistants: Agents that help users book meetings, set reminders, or reason about deadlines.
- Daily digest generation: Pipelines that generate summaries anchored to the current date.
- Business logic validation: LLMs evaluating time-based rules (e.g., "Is this invoice still within the payment window?").
No system prompt required
This module injects the datetime at the infrastructure level, so you don't need to add a timestamp to your system prompt in every application. Changes to the timezone or format take effect immediately without any code changes.