I have opened the case again. Removed cmos and put it back after a minute. It works now. The last time I did it, it didn't ask me to set the time. This time it did. I see that the time works fine even after many restarts.
Yep the main battery is dead. I'm contemplating if I want to spend more money on this laptop