isHoursPassed static method

bool isHoursPassed(
  1. String givenDateTime, {
  2. bool savedInUtc = true,
})

Checks if the given datetime has exceeded the specified minutes.

Implementation

static bool isHoursPassed(String givenDateTime, {bool savedInUtc = true}) {
  try {
    final dateTime = DateFormat("yyyy-MM-dd HH:mm:ss").parse(givenDateTime);
    final currentTime = DateTime.now();
    return currentTime.isAfter(dateTime); // true if the given time has passed
  } catch (e) {
    return true; // fallback if parsing fails
  }
}