Начало
Часы
Международная Организация по Стандартизации Часы
Показывает дату и время в соответствии с Международной Организацией по Стандартизации 8601 стандарт.
JavaScript Clocks: Международная Организация по Стандартизации Часы
<!-- THREE STEPS TO INSTALL ISO CLOCK: 1. Copy the coding into the HEAD of your HTML document 2. Add the onLoad event handler into the BODY tag 3. Put the last coding into the BODY of your HTML document --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <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"; } else { minutedifference = ":00"; } if (hourdifference < 10) { timezone = "0" + hourdifference + minutedifference; } else { timezone = "" + hourdifference + minutedifference; } if (diff < 0) { timezone = "-" + timezone; } else { timezone = "+" + timezone; } 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); } // End --> </script> </HEAD> <!-- STEP TWO: Insert the onLoad event handler into your BODY tag --> <BODY OnLoad="isodatetime()"> <!-- STEP THREE: Copy this code into the BODY of your HTML document --> <center> <form name=isoclock> <input type=text name=display size=30 style="border:0;"> </form> </center> <!-- Script Size: 2.17 KB -->