> ## Documentation Index
> Fetch the complete documentation index at: https://starrycodes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# DateTime - Comparison Extensions

> Instantly check if a DateTime falls on today, yesterday, tomorrow, or in the past/future, ignoring time components for calendar accuracy.

{/*     title="⚡ Quick Usage" */}

{/* > */}

{/* // Check relative to today */}

{/* // Check relative to the current moment */}

{/*   // Show a reminder */}

{/* ``` */}

### 1. 📅 Relative to Today

**isToday()** `bool`

Checks if the date falls on the exact same calendar day as today (time ignored).

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
final today = DateTime.now();
print(today.isToday()); // true
```

**isYesterday()** `bool`

Checks if the date was exactly one calendar day before today (time ignored).

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
final yesterday = myDate.subtract(const Duration(days: 1));
print(yesterday.isYesterday()); // true
```

**isTomorrow()** `bool`

Checks if the date is exactly one calendar day after today (time ignored).

```dart lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
final tomorrow = myDate.add(const Duration(days: 1));
print(tomorrow.isTomorrow()); // true
```

### 2. ⏳ Relative to Now

**isPast()** `bool`

Checks if the moment is in the past relative to the current system time (`DateTime.now()`).

```dart DateTime icon="calendar" lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
print(DateTime(2000, 1, 1).isPast()); // true
```

**isFuture()** `bool`

Checks if the moment is in the future relative to the current system time (`DateTime.now()`).

```dart DateTime icon="calendar" lines wrap theme={"theme":{"light":"github-light","dark":"github-dark-dimmed"}}
final reminder = DateTime.now().add(const Duration(hours: 1));
print(reminder.isFuture()); // true
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.