The Antikythera is sometimes called the first known analog computer. It is estimated to date around 150 - 100 BCE and was designed to flawlessly calculate the astronomical positions of celestial bodies and in effect is a sort of a calendar computer. Its complexity and degree of accuracy and sophistication is absolutely extraordinary and can only be compared to that of 19th century Swiss watches, which came 2,000 years after it.
The device is a mechanical, gear based analog calculator and is able to give exact estimates of the relative positions of the Sun, the Moon and some of the other planets. Though simpler, the Antikythera anticipates the more complex design of Charles Babbage’s Difference Engine, which is another mechanical (analog) computer designed way ahead of its time.
The video below shows off a working replica of the Antikythera that was built by Andrew Carol, an Apple engineer, using 1,500 Lego pieces.