The time it takes for light to travel from a source to Earth depends on the distance between the source and Earth. Light travels at a constant speed in a vacuum, which is approximately 299,792 kilometers per second (or about 186,282 miles per second).
To calculate the time it takes for light to reach Earth from a specific source, we can divide the distance between the source and Earth by the speed of light. Here are some approximate times for light to travel from common celestial objects:
Sun: The average distance from the Sun to Earth is about 149.6 million kilometers (93 million miles), so it takes about 8 minutes and 20 seconds for light to travel from the Sun to Earth.
Moon: The average distance from the Moon to Earth is about 384,400 kilometers (238,900 miles), so it takes about 1.28 seconds for light to travel from the Moon to Earth.
Andromeda Galaxy: The Andromeda Galaxy is our closest neighboring spiral galaxy, located about 2.537 million light-years away. Since a light-year is the distance light travels in one year, it would take approximately 2.537 million years for light from the Andromeda Galaxy to reach Earth.
Please note that these values are approximate and can vary due to factors like the actual distance between objects, the Earth's orbital position, and the relative motion between the source and Earth.