EC=IT

E x C = I x T

Voltage times Capacitance = Current times Time

The max voltage across the capacitor is 7 V (9 V battery minus the LED Vf)

C = (I x T) / E

C = (.02 x 3) / 7.0 = 0.0086 = 8600 uF

The resistor is calculated using Ohm's Law.

R=E/I

Resistance = Voltage divided by Current

R = 7 / 0.02 = 350 ohms

Explains how to find the capacitor needed to discharge the voltage threw the LED. I got that.. But how do I find out how long it will take for a capacitor, resistor to discharge the voltage?

Like for instance, this guy..

His parts.. 1000uF, or 0.001F Capacitor, 9v battery, and a 22k Ohm Resistor. The LED is red, which means it's 0.02A (20mA), and has a forward voltage of 2Vdc.

Finding the resistor for the LED.

9Vs - 2Vf = 7.0RVd

R = 7RVd / 0.02If = 350Ω

But I'm lost.. How do I figure out how long the LED will stay lit..? I know how to find the capacitor value for the RC Circuit I have.. But I don't know how to find how long the LED will stay lit, if I have a capacitor, and know the values of the component.

He says in the comments, that it will still be lit, even after 10 minutes.. Wouldn't you need a higher capacity capacitor to do stuff like that?

10 Minutes x 60 Seconds = 600 Seconds.

0.02A x 600 = 12

C = (0.02A (If) x 600s) = 12 / 7Vdc (Vf) = 1.71 Farads !!!!

That's EXPENSIVE !!! But he's not using a 1.71 Farad capacitor.

http://www.mouser.com/ProductDetail/Cornell-Dubilier/DCMC175U16FG2D/?qs=zv9oXRM5khgxb9WM9DbwmA==

It's $141.55 for a 1.7 Farad capacitor.