/**
* 時間對象的格式化;
*/
Date
/*
* eg:format="YYYY
*/
var o = {
"M+" :this
"d+" :this
"h+" :this
"m+" :this
"s+" :this
"q+" :Math
"S" :this
// millisecond
}
if (/(y+)/
format = format
}
for ( var k in o) {
if (new RegExp("(" + k + ")")
format = format
: ("
}
}
return format;
}
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20241.html