No. Carrots do contain high levels of Vitamin A which is essential to eyesight, among other things. However, eating carrots only makes a difference to sight for those who have a serious Vit A deficiency.
The myth was started by the British during World War 2 as a plausible explanation for their remarkable success rates at shooting down German planes at night. Stories were told about pilots with amazing night vision like, Lieutenant John “Cats Eyes” Cunningham who was said to have exceptional night vision thanks to his love of carrots.
In fact, the Brits were making use of a secret invention – radar – and they didn’t want the Germans to realize something was up. So they told the public that they were feeding the defenders massive amounts of carrots and that was leading to improved night vision.
They were so persuasive that the British public actually increased carrot consumption in an effort to improve their own night vision – which was important when cities were being blacked out to prevent bombing!