Teaching robots to perceive time -- A reinforcement learning approach (Extended version)