isToday static method

bool isToday(
  1. int microseconds
)

Checks if the given microseconds value corresponds to the current date.

Returns true if the date extracted from the microseconds value matches the current date; otherwise, returns false.

Parameters:

  • microseconds: The microseconds value representing a specific date and time.

Returns:

  • true if the date matches today's date; false otherwise.

Implementation

static bool isToday(int microseconds) {
  var calendar = DateTime.fromMicrosecondsSinceEpoch(microseconds);
  final now = DateTime.now();
  return now.day == calendar.day &&
      now.month == calendar.month &&
      now.year == calendar.year;
}