Its unexpected in the context of coding. Certain files need current date at least if not even time. I believe as Cursor added coding features for AI this part is missing
I also would like to use the current date in the naming of my adrs for instance.
I wonder if you could work around this limitation of LLMs with an mdc rule forcing cursor to run ‘date “+%Y-%m-%d”’ at the beginning of a composer session and use it inside the files created.
create a .cursor/rules/105-composer-date.mdc file with the below content
# Composer Date Handling
## Context
- When working with composer files or documentation that requires current date
- When date formatting needs to be consistent across the project
- When automated date insertion is needed
## Requirements
- Execute `date +%Y-%m-%d` to get the current date in YYYY-MM-DD format
- Store the date result in context for use in the current session
- Use the stored date consistently across all files that need it
- Update the date when a new session starts or when explicitly requested
## Examples
<example>
When asked about the current date or needing to insert it:
1. Execute: `date +%Y-%m-%d`
2. Store result (e.g., "2024-03-21")
3. Use stored date in files or responses
</example>
<example type="invalid">
- Do not hardcode dates
- Do not use different date formats
- Do not skip executing the date command when a new date is needed
</example>
Ask composer what the date is, click run when prompted.
To work around this I created a crontab in my system that will update a Cursor rule e.g. 0000-current-datetime.mdc with the current datetime e.g. 2025-03-03 17:56 CET. You then have to gitignore that file.
This is way over engineered as well but at least it does not require any command breaking the LLM output streaming.
yeah, its interesting that Cursor always ads CWD to the prompt where its actually strange to have it sent to AI all the time unnecessarily. date-time would help so much.
That’s “normal” but it would be trivial to include the date of the current day in Cursor’s system prompt, and furthermore the current time.
I have a recurring issue in Cursor, where I give it instructions to look in my application’s logs for errors, but it will bring back days old issues as it has absolutely no sense of time and as people previously said I see this being an issue with things like updating documentation and such…
Including in Cursor’s system prompt the date would only add a few tokens per request, if that’s too expensive to include in all requests for Cursor by default it would be nice to at least have the option of including the current time.
Sure, and Cursor already has the idea to pipe my log command through tail to get the last fifty lines, I think I’ll just add this to my instructions, but if I get a longer error message it may truncate it halfway through…
And including date and time would still be a positive change for other reasons, maybe there’s a technical reason why Cursor’s engineers don’t include it in their system prompt, but as ChatGPT does it I don’t see why it would be more of an issue in Cursor.
As a workaround for now some use scripts to insert date at end of .cursorrules when they start Cursor, or anywhere else practical (incl. snippets as keyboard shortcuts etc..)
Hmm the agent 2 agent (A2A) protocol could also be added by having a local LLM check if an agent is doing work and inject the current time into prompt. Just kidding.
Most performant solution is a date statement in the shell init file to output on shell start the current date and time. No MCP calls required, no prompt injections etc.