Always put hat on baby?

This is my first baby, learning everyday. But today I was unsure about putting a hat on my baby. It was so hot today!! But I've been told and read to put hat on baby to help against sunburn. So I started out with the hat, but took it off pretty soon after I'd started my errands. My son looked so annoyed, lol. He seemed less irritable when I ditched his hat

Thoughts on hats?