First: It does not work. Can you help me.
Below the whole code I used.
Second: I would like to have the result in YEARS. Like “”I am 65 years old”.
<HTML><HEAD><TITLE>How many days old are you</TITLE>
</HEAD>
<BODY><CENTER>
<BR><BR>
<TABLE BORDER=”1″ WIDTH=”95%” CELLSPACING=”0″ CELLPADDING=”0″>
<TR><TD><FONT CLASS=”titulo7v”>
<CENTER>SCRIPT para cálculo do tempo em dias entre uma data e datal atual<CENTER>
<SCRIPT LANGUAGE=”JavaScript”>
<!– How long have you had that job? How many days old are you?
Find the answers to these questions and more!
This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com
<!– Begin
var montharray=new Array(“Jan”,”Feb”,”Mar”,”Apr”,”May”,”Jun”,”Jul”,”Aug”,”Sep”,”Oct”,”Nov”,”Dec”);
function countup(yr,m,d) {
var today=new Date();
var todayy=today.getYear();
// Y2K Fix by Isaac Powell
// [url]http://onyx.idbsu.edu/~ipowell[/url]
if ((navigator.appName == “Microsoft Internet Explorer”) && (todayy < 2000))
todayy=”19″ + todayy;
if (navigator.appName == “Netscape”)
todayy=1900 + todayy;
var todaym=today.getMonth();
var todayd=today.getDate();
var todaystring=montharray[todaym]+” “+todayd+”, “+todayy;
var paststring=montharray[m-1]+” “+d+”, “+yr;
var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1);
document.write(“JSS was created ” + difference + ” days ago.”);
}
countup(1997,08,29); // Date in format: (year,month,day)
// End –>
</script>
<p><center>
<font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br>
by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
</center><p>
<!– Script Size: 0.99 KB –>
</TD></TR></TABLE>
</BODY>
</HTML>