A neural mechanism for learning temporal expectancies