Date
From PlainOldWebserver
Date()
For Date, you can use the Date.toString() method or write your own routine. This output is short and easily sorted.
var date = new Date();
var year = date.getYear()+1900;
var month = date.getMonth()+1;
var day = date.getDate();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var date_string = year+"-0"+month+"-0"+day + " 0"+hours+
":0"+minutes+":0"+seconds;
date_string = date_string.replace(
/(\d+)-\d*(\d{2})-\d*(\d{2}) \d*(\d{2}):\d*(\d{2}):\d*(\d{2})/,
"$1-$2-$3 $4:$5:$6");
document.writeln("date is "+date_string);
Result:
date is 2007-01-08 21:21:14
