Sundials are the oldest known instruments for telling time. The surface of a sundial has markings for each hour of daylight. As the Sun moves across the sky, another part of the sundial casts a shadow on these markings. The position of the shadow shows what time it is.
Sundial works on the principle that the sun takes up similar positions each day. Depending on the location of the sun with respect to the dial, the dial would have different shadows by which people can approximately tell the time of the day.