Calculating the time by the light position