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.