直接上代码:
//将国际化日期转化成本地日期yyyy-MM-dd
function f_ToDate(num) { //Fri Oct 31 18:00:00 UTC+0800 2008
num = num + "";
var date = "";
var month = new Array();
month["Jan"] = "01"; month["Feb"] = "02"; month["Mar"] = "03"; month["Apr"] = "04"; month["May"] = "05"; month["Jun"] = "06";
month["Jul"] = "07"; month["Aug"] = "08"; month["Sep"] = "09"; month["Oct"] = "10"; month["Nov"] = "11"; month["Dec"] = "12";
//var week = new Array();//http://yige.org
//week["Mon"] = "一"; week["Tue"] = "二"; week["Wed"] = "三"; week["Thu"] = "四"; week["Fri"] = "五"; week["Sat"] = "六"; week["Sun"] = "日";
str = num.split(" ");
date = str[5] + "-";
date = date + month[str[1]] + "-" + str[2];
//date=date+" 周"+week[str[0]];
return date;
}
资源均来自第三方,谨慎下载,前往第三方网站下载