Cursor doesn't know the date

I often need to add a last updated timestamp to my apps. For example on developer documentation etc.

Cursor consistently gets the date and year incorrect and when I query it, says it doesn’t have access to the date and time.
is this normal ?

Prompt: Can you tell me what day and date and time it is?
Cursor: Today is Wednesday, February 14, 2024. I don’t have access to the current time.

Hey, yes, that’s normal. No AI through an API will tell you what today’s date is because they don’t have access to real-time updates.

OpenAI:

Anthropic:

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.

Here is my workaround that works in composer.

  • 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.

Kinda overengineered, but why not :slight_smile:

2 Likes

sure but spending a prompt every time the IDE needs to include a date into code or docu? ufff

FYI: The ChatGPT interface includes the current date in its system prompt, and Zed supports this via a command.

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.

@Cursor team please add this in context :pray:t2::pray:t2::pray:t2:

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.