Sure the generator is providing correct, stable output needed for a PC? Sounds like your motherboard battery might have died and needs to be replaced... Since you didn't post the PC model number, we can't direct you to the right Service Manual. So go to the Support site and enter your Service Tag (don't post it here). When the site ID's your PC, open its Service Manual and follow the instructions to replace the battery. It's likely a CR2032 3-volt coin cell, ~$2, available at most big box stores, drugstores, hardware stores , etc...
I'm currently in a situation where I'm running my computers from a generator. When I unplug and turn the generator off and then later, turn the generator back on and re-plug in, the Dell Inspiron desktop gives me a hard time, as follows: Once it is plugged back in, the on switch lights up by itself and then cycles 3 times, turning itself on and off. Finally, a page comes up that says the time and date need to be reset, it's from the computer, not windows.  I'm given the option of running diagnostics, which I have tried but it does nothing. If I click "continue," the computer starts up windows but the time and date are wrong. Next, it won't take my PIN because of "repeated starts," and I need to enter my MS password. Then when windows starts, it's reluctant to find my Verizon WiFi device. Then I must manually correct the date and time, but in comment streams it's still wrong. I've also noticed the cursor gets sluggish occasionally.  If I turn it off and on with the electricity still on, it restarts normally.  If this is built into the computer by Dell, it's ridiculous and will keep me from buying anymore of their products. This is a thousand dollar device that I've only used a total of about 14 months. There is no reason why you should have to keep the machine continuously plugged in. It saves energy unplugging it, plus protection from power surges. Should I give up on Dell and buy an HP instead?  
Computer malfunctions after being unplugged