What is the formula used to determine the temperature and wavelength of sunlight entering the atmosphere? I tried Wien's formula (LT = 3E6 nm * K), but I get skewed results.

When I plug in the wavelength for yellow light (570 nm), I get the sun's surface temperature. When I plug in an earth temperature, I get an extremely long wavelength. It is my understanding that sunlight that enters the atmosphere has shorter waves and cooler temperatures.

Please assist. Thanks in advance.

:-D