Skip to main content
1

📅 Relative to Today

isToday()
bool
Checks if the date falls on the exact same calendar day as today (time ignored).
final today = DateTime.now();
print(today.isToday()); // true
isYesterday()
bool
Checks if the date was exactly one calendar day before today (time ignored).
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).
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()).
DateTime
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()).
DateTime
final reminder = DateTime.now().add(const Duration(hours: 1));
print(reminder.isFuture()); // true