From sundials to atomic clocks: understanding time and frequency