Met Office statistics showed the Shetland area had 192.9 hours of sunshine from 1-29 July, while Cornwall had 153.5 hours.
Shetland lies about 700 miles (1,130 km) to the north east of Cornwall.
It was a wet month for the UK as a whole, with 22% more than the average rainfall for July.
Properties were damaged and people had to be rescued after heavy rain and storms hit the Cornish village of Coverack.
Climate scientist Mike Kendon said while it hadn't been a remarkable weather month, there were some "significant events".
"It is uncommon for Shetland to experience more sunshine hours than Cornwall at this time of year," he said.
"There is also a notable gradient between a cooler, sunnier and slightly drier than average north-west and a wetter, dull and warmer than average south-east."
One of the wettest places in July was Hampshire - which received 118% more than its average rainfall for the month.
Northern Ireland was the wettest region of the UK, with 39% more rain the average.
Get news from the BBC in your inbox, each weekday morning
The Shetland Islands had more sunshine than Cornwall in July - only the eighth time this has happened since records began in 1929.