working out the time