📕

Cursor Rule: LLMの間違った日付時刻を防ぐ方法

に公開

概要

システムの正確な日付・時刻を取得するためのCursorルールです。ウェブ検索ではなく、ターミナルコマンドを使用することで、より信頼性の高い時刻情報を得ることができます。このルールにより、CursorのLLMが古い学習データや不正確な情報に基づいて間違った日付・時刻を使用することを防ぐことができます。

使用場面

  • プロジェクトドキュメントの日付更新
  • ファイルの更新日時設定
  • ドキュメント生成時の日付挿入
  • プロジェクト計画の作成・更新
  • 計画管理・実装プロセスでの進捗追跡
  • 時間に関連するあらゆる操作

Cursor Rule

date-time-best-practices.mdc
---
description: Guidelines for reliably obtaining current date and time using system commands instead of web search results
globs:
alwaysApply: false
---

# Date and Time Best Practices

## Getting Current Date and Time

When you need to get the current date and time, always prioritize system time over web search results.

### ✅ Recommended Approach
Use terminal commands to get accurate system time:
```bash
date
```

### ❌ Avoid
- Web search results for "today's date" can be unreliable or cached
- Online date websites may show incorrect information
- Time zone differences can cause confusion

### Example
```bash
# Get current system date and time
date
# Output: Sun Jul 13 22:07:07 JST 2025

# Get date in specific format
date "+%Y-%m-%d"
# Output: 2025-07-13
```

### Why System Time is More Reliable
1. **Accuracy**: System time is synchronized with NTP servers
2. **Local Time Zone**: Automatically shows the correct local time
3. **Real-time**: Always current, not cached
4. **Consistent**: Same across all terminal sessions

### Use Cases
- Updating project documentation dates
- Creating timestamps for logs
- Setting file modification dates
- Any time-sensitive operations

使用例


Discussion