Can I dry PETG filament under sun?
The simple answer is: No
There are two basic reasons for this:

The sun will not get the filament hot enough to evaporate any moisture which has been absorbed.
While sitting out in the sun, it will continue to absorb more moisture, which defeats the purpose.

On Matter Hackers, they give a very reliable way to dry filament:


Preheat your oven to 160-180°F  (or 70-80°C).

Place spool in oven for 4-6 hours

Remove and place in an airtight container, preferably with desiccant. 5-gallon buckets with airtight lids from local hardware stores work very well for filament storage. You can use uncooked rice as a cheap desiccant.


Filaments with lower glass transition temperatures (Tg) like PLA, use lower temperatures to dry. Lower temperatures also require more time to thoroughly dry.
That’s really all that’s necessary to dry out your filament and ensure optimum material performance and surface finish.
So if you have some spools that have been sitting out for a while and aren’t printing as well as they used to, dry them out and try again. Chances are they’ll be like new.

You can see in the write-up it states you need to get the oven up to 160-180°F (or 70-80°C). The sun will never provide that level of heat. It also states at lower temps it takes longer to evaporate all of the moisture. Placing the filament into an oven at the proper temps will ensure the best results short of buying a purpose built system like PrintDry which is also mentioned in the article.