<script>
          var date=new Date();
          var year=date.getFullYear();
          var month=date.getMonth();
          var day=date.getDate();
          var hour=date.getHours();
          var minute=date.getMinutes();
          var second=date.getSeconds();
          
 var s=""+year+"年"+month+"月"+day+"日"+hour+"时"+minute+"分"+second+"秒";
   document.write(s+"<br/>");                       //2017年8月22日22时32分0秒   
   document.write("<hr/>");               
   document.write(date.toLocaleString()+"<br/>");   //2017/9/22 下午10:30:18
   document.write("<hr/>");               
   
   document.write(date.toLocaleDateString()+"<br/>");//2017/9/22
   document.write("<hr/>");               
   
   document.write(date.toLocaleTimeString()+"<br/>");//下午10:30:18


 
</script>