I retrieve a list of date from a DB using JS and ADO and I show it in a table with the following code:
var detDate = new Date() ;
if(!rsDetail.bof) {
rsDetail.MoveFirst()
while(!rsDetail.eof) {
detDate = rsDetail.fields(2).value;
rsDetail.MoveNext()
}
... TableHtml += '<td>' + detDate + '</td>' ...
The output looks like that: Sat Oct 15 00:00:00 EDT 2011
I want it to look like that: 2011-10-15
I have been looking around at the JS date object and I tried to do formatDate(detDate,'y-mm-dd')
but it doesn't work...