I have been wanting a datestamp code for some time in InDesign.

I found a post on this forum that gave me a long date (while this isn't automatic, it allows you to select a insert point and then double click on the script from the pallet).

The code that was previously posted gave a long date format ie.Wednesday, June 9 2004

the code for this (for reference is):

//DESCRIPTION: Insert date at insertion point.
today = new Date();
myDateString = today.toLocaleDateString();
myParts = myDateString.split(" 0");
if (myParts.length != 1) {
myDateString = myParts[0] + " " + myParts[1];
}
app.selection[0].contents = myDateString;
//End Code

I wanted a short date format so I can up with this:

//DESCRIPTION: Insert date at insertion point.
today = new Date();
month = today.getMonth()+1;
year = today.getYear();
day = today.getDate();
if(day<10) day = "0" + day; if(month<10) month= "0" + month ; if(year<1000) year+=1900; app.selection[0].contents = (month + "/" + day + "/" + (year+"").substring(2,4)); //End Code

Hope this helps some people.