UTC javaScript 日期变换

UTC javaScript 日期转换
function   Todate(num)
{ //Fri Oct 31 18:00:00 UTC+0800 2008
num=num+"";
var date="";
var month=new Array();
month["Jan"]=1;month["Feb"]=2;month["Mar"]=3;month["Apr"]=4;month["May"]=5;month["Jun"]=6;
month["Jul"]=7;month["Aug"]=8;month["Sep"]=9;month["Oct"]=10;month["Nov"]=11;month["Dec"]=12;
var week=new Array();
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;
}

具体请点击:http://www.verydemo.com/demo_c98_i19562.html

你可能感兴趣的:(JavaScript)