I used to work security at an air show. From the time I started until one particular year, the dress codes for cops, firefighters, EMT's, security, and logistics included 'no shorts'.
Well, one year it was so hot that it was decided that wearing long pants may lead to heat related problems with the help. Some of which were volunteers who could go home if they really wanted to.
I think we had rules like no cut offs, or jean shorts. Khaki was deemed OK. I hate wearing shorts and would rather tolerate the heat, but that year was an exception.
I don't wear shorts at work for any reason. Even though we live in Michigan, it still gets hot, almost 100 degrees, here every summer, I just don't feel comfortable working in them.