There are two possible principles:
1. Determining the direction of the sun (azimuth). A magnetc compass is necessary.
2. Determining the altitude of the sun. A compass is not necessary, but at noon the dial will not work: The change of the altitude of the sun is small. All my reproduction dials are based on this altitude principle.
The dials give different times: True local time, mean zone time (Table Dial), or temporal hours (Roman Dial): the time between sunrise and sunset is divided into 12 equal parts. The length of such a temporal hour depends from the date and the geogr. latitude.
History of the sun dial
Since prehistory men may have used the length of the own shadow as a first dial. They found other sun-"clocks" in nature: mountains (e.g. Midday-Peak) or other features of the horizon are used as time-markings. Then, the step to an artificial sun-dial with a gnomon was a small one. Until today, igenious sun-dials are invented, constructed and looked at with fascination. In contrary to the astrolabe, the sun-dial is both, a very old instrument as well as an actual instrument of our time.