Thoth, shown as an ibis or an ibis-headed man and associated with the moon, is the Egyptian god of writing, wisdom, reckoning and the measurement of time, credited with inventing the sacred script (the medu netjer, the god's words, which the Greeks called hieroglyphs) and with recording all knowledge. His functions follow from that: he is the scribe who writes down the verdict at the weighing of the heart, the arbitrator who settles the disputes of the gods, the measurer of time who fixes the calendar, and the master of the words of power that make Egyptian magic work. Scribes, whose literacy set them apart in Egyptian society, honoured him as their patron, and a scribe might pour out a drop of water before writing as a libation to Thoth.
One of the best-attested Egyptian myths about the calendar itself turns on Thoth. According to the account preserved by the Greek writer Plutarch, the sun-god Ra, angry at the sky-goddess Nut, cursed her to be unable to give birth on any day of the 360-day year; Thoth, in his role as the clever, wise arbiter, won at a game of chance against the moon and gained enough extra light to create five additional days outside the regular year, the epagomenal days, on which Nut was then able to bear Osiris, Isis, Set, Nephthys and, in some versions, Horus the Elder. The myth doubles as an explanation for the 365-day Egyptian civil calendar's extra five days beyond twelve even lunar months.