The popular comic xkcd posed this equation for converting time complete into a date:
I’ve been trying to do the same in JavaScript, although I keep getting -Infinity. Here’s the code:
var p = 5; // Percent Complete
var today = new Date();
today = today.getTime();
var t;
t = (today) - (Math.pow(Math.E, (20.3444 * Math.pow(p,3))) -
Math.pow(Math.E,3));
document.write(t + " years");
Time will return a huge number (milliseconds), and I know that the equation isn’t meant to deal with milliseconds – so how would one do an advanced date equation with JavaScript?

You’ve made 3 mistakes:
pshould be a decimal between 0 and 1 to indicate the ratio of progress completed.T = (current date) - (a number in years)not
T = (current date - a number) in yearsYou need to first calculate
(e^…-e^3)and then subtract that many years fromt+3which was in the original formulaEDIT:
Here’s some working code as a JSFiddle, although Javascript runs out of dates at around 75% completed