这是一款js获取系统时间特效,将获取到的系统动态时间在文本框内动态显示,根据自己的需求来修改即可。
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin function isodatetime() { var today = new Date(); var year = today.getYear(); if (year < 2000) year = year + 1900; var month = today.getMonth() + 1; var day = today.getDate(); var hour = today.getHours(); var hourUTC = today.getUTCHours(); var diff = hour - hourUTC; var hourdifference = Math.abs(diff); var minute = today.getMinutes(); var minuteUTC = today.getUTCMinutes(); var minutedifference; var second = today.getSeconds(); var timezone; if (minute != minuteUTC && minuteUTC < 30 && diff < 0) { hourdifference--; } if (minute != minuteUTC && minuteUTC > 30 && diff > 0) { hourdifference--; } if (minute != minuteUTC) { minutedifference = ":30"; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) else { minutedifference = ":00"; } if (hourdifference < 10) { timezone = "0" + hourdifference + minutedifference; } else { timezone = "" + hourdifference + minutedifference; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) if (diff < 0) { timezone = "-" + timezone; } else { timezone = "+" + timezone; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) if (month <= 9) month = "0" + month; if (day <= 9) day = "0" + day; if (hour <= 9) hour = "0" + hour; if (minute <= 9) minute = "0" + minute; if (second <= 9) second = "0" + second; time = year + "-" + month + "-" + day + "T" + hour + ":" + minute + ":" + second + timezone; document.isoclock.display.value = time; window.setTimeout("isodatetime();", 500); }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) // End --> </script> <body OnLoad="isodatetime()"> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <center> <form name=isoclock> <input type=text name=display size=30 > </form> </center> </body>
本文来自武鸣人网站,转载请注明出处