Accurate measurement of time is necessary in a number of fundamental and applied areas of science. The caesium clock, which operates in the microwave regime, is currently used to define a second. However, there have been remarkable advances in optical clocks in recent years, and it now seems clear that one such clock will replace the caesium clock and serve as the standard of time in the future. The talk will give an introduction to atomic clocks and emphasise the basic physical principles on which they work. The advantages of optical clocks over the caesium clock will be discussed. The important features of trapped ion optical clocks and optical lattice clocks which have enabled them to achieve accuracies of 1 part in 10^17 ? 10^18 will be presented.