On a 24 hour clock basis (no date), there is no time that's both greater than 9PM and less than 3AM. You have to check whether the time is between 9PM and 11:59:59PM or between 00:00:00AM and 3AM. If either one is true, the time is between 9PM and 3AM.