把时间转换成时间戳
<script type="text/javascript">
function transdate(Time){
var date=new Date();
date.setFullYear(Time.substring(0,4));
date.setMonth(Time.substring(5,7)-1);
date.setDate(Time.substring(8,10));
date.setHours(Time.substring(11,13));
date.setMinutes(Time.substring(14,16));
date.setSeconds(Time.substring(17,19));
return Date.parse(date)/1000;
}
document.write(transdate('2014-11-11 00:00:00'));
</script>
已有 0 条评论