Who invented the sundial?

No one knows. It could have been the Mesopotamians, or the early Babylonians. Sundials have been found in many ancient cultures. The Egyptians used sundials, as well as the Ancient Greeks and Romans.