2、学习《细说PHP》笔记二

<center>
  <b>使用JavaScript显示当前日期及时间</b><p></p>
</center>
<script type="text/javascript" language="javascript">
  var current_time=new Date();
  with(current_time){
    var strDate="现在是:";
    strDate += getFullYear()+"年";
    strDate += (getMonth()+1)+"月";
    strDate += getDate()+"日";
    strDate += getHours()+":";
    strDate += getMinutes()+":";
    strDate += getSeconds();

    document.write(strDate);
  }
</script>

效果图:

坚持,再坚持
原文地址:https://www.cnblogs.com/phpcqy/p/14288767.html