Here is one suggestion.
You may need to replace the PRAM battery. It is a 3 volt, lithium CR2032 watch/camera battery available at stores like Walmart, Kmart, Target, or most drugstore chains. You should be able to the replacement yourself on any G5 iMac EXCEPT the iSight models.
Here's a link to the PRAM battery:
Watch this video on installing RAM in the G5 iMac, as it will show you how to open the back of your G5 iMac: