isSameDay static method

bool isSameDay(
  1. int t1,
  2. int t2
)

t1 : eg: DateTime.now().millisecondsSinceEpoch) return: 是否是同一天

Implementation

static bool isSameDay(int t1, int t2) {
  DateTime time1 = DateTime.fromMillisecondsSinceEpoch(t1);
  DateTime time2 = DateTime.fromMillisecondsSinceEpoch(t2);
  if (time1.day != time2.day) {
    return false;
  }
  if (time1.month != time2.month) {
    return false;
  }
  if (time1.year != time2.year) {
    return false;
  }
  return true;
}