A lunar day is the time it takes for Earth's Moon to complete on its axis one synodic rotation, meaning with respect to the Sun.
Due to tidal locking, this equals the time that the Moon takes to complete one synodic orbit around Earth, a synodic lunar month, returning to the same lunar phase.
Relative to the fixed stars on the celestial sphere, the Moon takes 27 Earth days, 7 hours, 43 minutes, 12 seconds to complete one orbit;[1] however, since the Earth–Moon system advances around the Sun at the same time, the Moon must travel farther to return to the same phase.
On average, this synodic period lasts 29 days, 12 hours, 44 minutes, 3 seconds,[1] the length of a lunar month on Earth.
The exact length varies over time because the speed of the Earth–Moon system around the Sun varies slightly during a year due to the eccentricity of its elliptical orbit, variances in orbital velocity, and a number of other periodic and evolving variations about its observed, relative, mean values, which are influenced by the gravitational perturbations of the Sun and other bodies in the Solar System.