Use Cah triangle C being capacity (in this case 9v) a being amps (in this csae 6.3ma) and h being hours. So we divide 9v by 6.3ma wich is 1428.6 your battery should last 1428.8 hours.
Hi,
Wow, where did you get that battery? I'd like to get one of those for sure!
On the more serious side...
The rough estimate is based on the Ah (or mAh) capacity of the cell and the load current as you noted, but when working in mAh and mA load just divide the mAh rating by the load current in mA, and that gives you the run time in hours.
So to make this simple a few examples:
400/4=100 hours (4ma load)
400/40=10 hours (40ma load)
400/400=1 hour (400ma load)
However, that 400mAh rating is probably given at the 20 hour discharge rate, so anything shorter than 20 hours will show less capacity and anything over 20 hours will show more capacity.
The 20 hour discharge current would have to be:
400/20=20ma
so for a 10ma load we estimate:
400/10=40 hours
and it will actually be a little more then that. It's hard to say exactly how much without having at least two discharge curves for the battery.
But another key factor is what the minimum voltage the application load can take without failure or going into undervoltage mode. If the load can take a serious undervoltage then you're good to go, but if the load can only take a small decrease from the starting voltage of around 9 volts, then the run time could be much, much shorter. By much, much shorter i mean as low as 25 percent of the estimation above. That's because the manufacturer uses it's own idea of what the *ending* voltage should be at the end of the 20 hour discharge period used to rate the battery. If they chose a high voltage that's good, but if they chose a low voltage then the run time will be much shorter.
The best bet is to buy a few new batteries and test it. Run it at the mode you intend to run it at and see how long it stays 'on'. If you intend to use a different brand of battery later, you may have to repeat the test to be sure because different manu's use different techniques to rate the battery. Of course this is if the application is critical in some way.
Also, for critical apps, you should always have some more batteries on hand just in case the first one happened to have much lower capacity than the rest for some unknown reason like shelf life or accidental discharge, etc.