I am having the same issue, i was about to post another topic about it until i saw this post. I would also love a better solution, i have a small work around though if that helps, although it isn’t perfect.
Is there a way for Cursor to get the current date? When adding comments.
Currently i have to change the date manually in the cursor rules, but it would be nice to get the current time and date. I tried to get it to run a terminal command to get the date, but it ignored that. Currently i just change the date in the rules everyday, but looking for a better way to do that.
By the above, i mean so that the Chat & Composer add the date, as i know there are plugins to do it manually.
It would be super helpful when you try to keep track of your progress and want to create for example an md file in where cursor will add a new entry with current date and a title
That would be great
Would also be quite helpful when composer is generating migrations, e.g. in laravel which are named with the data. Composer always name them 2024-03-21, probably because that’s the knowledge cutoff for Claude 3.5?
Given that this is marked as solved, when can we expect the checkbox to appear?
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..)