compareTimeTo method

int compareTimeTo(
  1. DateTime other
)

Implementation

int compareTimeTo(DateTime other) {
  if (this.hour > other.hour)
    return 1;
  else if (this.hour == other.hour) if (this.minute > other.minute)
    return 1;
  else if (this.minute == other.minute) if (this.second > other.second)
    return 1;
  else if (this.second == other.second)
    return 0;
  else
    return -1;
  else
    return -1;
  else
    return -1;
}