I'd try the usual generic reset (power removed, hold the power button for 60 seconds, try again) but given the age, replace the CMOS battery inside. It's less than 2 bucks.
https://www.google.com/search?q=HP+Touchsmart+310+PC&ie=utf-8&oe=utf-8#q=HP+Touchsmart+310+PC+cmos+battery finds folk with machines that won't turn on but I don't find HP documenting how to change this part.
https://www.google.com/search?q=HP+Touchsmart+310+PC&ie=utf-8&oe=utf-8#q=HP+Touchsmart+310+PC+cmos+battery&tbm=vid doesn't find it either but some folk are replacing boards. Your symptom does not lead us to any specific board.
Get estimates.
Bob

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic