日期:2014-05-16 浏览次数:20458 次
//只在Chrome的控制台试了下,不知道IE下行不
var str="2013-06-09T05:25:25Z"
str=str.replace("T", " ").replace("Z","")
var date = new Date(str)
alert(date.toLocaleString())
window.onload=(function(){
var a = "2013-06-09T05:25:25Z";
a = a.replace("T"," ").replace("Z","");
var date = new Date(Date.parse(a.replace(/-/g, "/")));
var year = date.getFullYear();//年
var month = date.getMonth()+1;//月
var day = date.getDate();//日
var hours = date.getHours();//小时
var minutes = date.getMinutes();//分钟
var seconds = date.getSeconds();//秒
alert(year+"年"+month+"月"+day+"日"+" "+hours+"时"+minutes+"分"+seconds+"秒");
});