the function goes in the script tag
<script type="text/javascript">
function DiffDate(dFrom, dTo){
var df=new Date(dFrom.getFullYear(),dFrom.getMonth(),
dFrom.getDate(), 0);
var dt=new Date(dTo.getFullYear(),dTo.getMonth(),
dTo.getDate(), 12);
return Math.floor( dt.valueOf()/(24*60*60*1000) -
df.valueOf()/(24*60*60*1000) );
}
</script>
the function will take 2 parameters
dFrom - the date you want to start counting
dTo - the date you want to finish
in the page you could write it like this
<body>
<script type="text/javascript">
// use 'mm/dd/yyyy' format
var dFrom = '12/31/2003';
var dTo = '01/12/2004'
document.write DiffDate(dFrom, dTo)
</script>
</body>
Not very functional as you can see - what is it you want to do with it ?