the <=> operator takes care of that. It compares the two times and if the first argument (Time.now) is greater than the second, then the answer is 1