时间操作(JavaScript版)—页面显示格式:年月日 上午下午 时分秒 星期

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
    <head>  
        <meta http-equiv="Content-Type" content="text/html; charset=GB2312" />  
        <title>页面显示格式:年月日 上午下午 时分秒 星期</title>  
        <script language="javascript">  
            setInterval("timer.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);   
        </script>  
    </head>  
  
    <body>  
        <div id="timer"></div>  
    </body>  
</html>
【推广】 免费学中医,健康全家人
原文地址:https://www.cnblogs.com/llguanli/p/8452188.html