I have good news and I have what might be bad news.
The good news is that the problem is most likely a simple dead battery.
The bad news, is that replacing the battery could be difficult.
Become a Patron of Ask Leo! and go ad-free!
First, I should point out we’re not talking about the laptop battery – the one you can get at and replace, and the one that gets recharged when you plug your laptop in. The battery I’m talking about is a very small battery, typically called the CMOS battery, whose job is to retain your BIOS settings when the power is off.
And keep the clock running when the power is off.
I have a similar problem on one of my older Dell laptops. When I looked into it, I found that the battery could be replaced, but only by almost completely disassembling the laptop first.
Needless to say, the battery has not been replaced. (The laptop sits in my basement now, continuously plugged in, as one of my test machines.)
So my advice is this: go to the HP support website and look into what it might take to replace the CMOS battery. I’m hopefully that my Dell’s difficulty is the exception rather than the rule, and that you’ll be able to replace yours easily. But in any case, it’ll depend on the specific model of laptop you happen to have.