Is there a software that tells for how long the computer has been running on battery?
In OSX 10.9 and above this is all in Activity Monitor app under the Energy tab. 
It shows your battery life over the last 12 hours, and while it was plugged in is highlighted in green. It also shows you what apps are sucking on your battery and how much they are draining at the moment, and on average.