E.l. Konigsburg said this quote

Friendship depends on interlocking time, place, and state of mind.