返回获取系统时间...登陆

获取系统时间

肖凌2019-05-14 13:14:44240

<!DOCTYPE html>

<html>

         <head>

         <title>Date获取</title>

         </head>

         <body>

                         <div id="timeId"></div>

                         <script type="text/javascript">

                                         var m_day=new Date();

                                         document.write(m_day+'<br>');

                                         var year=m_day.getFullYear();

                                         document.write('<br>');

                                         document.write(year);

                                         document.write('<br>');

                                         var month=m_day.getMonth();

                                         document.write(month+1);

                                         document.write('<br>');

                                         var m_month=new Array(12);

                                         m_month[0]="一月";

                                         m_month[1]="二月";

                                         m_month[2]="三月";

                                         m_month[3]="四月";

                                         m_month[4]="五月";

                                         m_month[5]="六月";

                                         m_month[6]="七月";

                                         m_month[7]="八月";

                                         m_month[8]="九月";

                                         m_month[9]="十月";

                                         m_month[10]="十一月";

                                         m_month[11]="十二月";

                                         document.write(m_month[m_day.getMonth()]);

                                         document.write('<br>');

                                         document.write(m_day.getDay());

                                         document.write('<br>')

                                         document.write(m_day.getHours()+'时');

                                         document.write(m_day.getMinutes()+'分');

                                         document.write(m_day.getSeconds()+'秒');

                                         function t_time(){

                                         var t_day=new Date();

                                         var m_time=t_day.getHours()+'时'+t_day.getMinutes()+'分'+t_day.getSeconds()+'秒';

                                         document.write(m_time);

                                         }

                                        

                                         setInterval(t_time,1000);

                                         function timeSet(){

                                         var r_day=new Date();

                                         document.getElementById('timeId').innerHTML=r_day.getSeconds()+'秒'

                                         }

                                         setInterval('timeSet()',1000);

                        

                         </script>

         </body>

</html>


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送