这将产生一个 javascript 格式:2012 年 8 月 9 日
var month = [1,2,3,4,5,6,7,8,9,10,11,12];
var month2 = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
var day = postdate.split(-)[2].substring(0,2);
var m = postdate.split(-)[1];
var y = postdate.split(-)[0];
for(var u2=0;u2<month.length;u2++){
if(parseInt(m)==month[u2]) {
m = month2[u2] ; break;
}
}
var daystr = day+ ' ' + m + ', ' + y ;
如何在上面的javascript中添加日期名称和时间?
例如:2012 年 8 月 9 日星期四下午 5:28