When were sunglasses invented?

In 1929, Sam foster. Sold the first pair of sunnies 8-)

2009 (MMIX), the common year starting on Thursday in the Gregorian calendar
Originally tinted glasses were experimented with to help cure certain vision and health issues. In some cases they were used to prevent someone seeing the eyes while they were questioned for court cases.

They became commercially viable in 1929 when Sam Foster began making and selling inexpensive versions. They took off after World War II as the GI's and many pictures of them in glasses, particularly pilots and General MacArthur made them popular.