A sundial shows the time by displaying the position of a shadow on a (usually) flat surface, which has markings that correspond to the hours.
Sundials can be horizontal, vertical, or in other orientations.
When the Sun is shining, its apparent position in the sky moves during a day, reflecting the rotation of the Earth. Shadows cast by stationary objects move correspondingly, so their positions can be used to indicate the time of day.
With the knowledge of latitude, a well-constructed sundial can measure local solar time with reasonable accuracy, within a minute or two.
Sundials were widely used in ancient times, and continue to be used to monitor the performance of clocks into the modern era.
However, practical limitations, such as the fact that sundials work only when the Sun shines, and never during the night, encouraged the use of other techniques for measuring and displaying time.
Sun dials are still a fun accessory to have in your garden or on your patio today.