24 lines
761 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function clock() {
var d = new Date();
var day = d.getDate();
var hrs = d.getHours();
var min = d.getMinutes();
var sec = d.getSeconds();
var mnt = ["января", "февраля", "марта", "апреля", "мая",
"июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"];
if (day <= 9) day = "0" + day;
if (hrs <= 9) hrs = "0" + hrs;
if (min <= 9) min = "0" + min;
if (sec <= 9) sec = "0" + sec;
$("#time").html("Время: " + hrs + ":" + min + ":" + sec + "&nbsp;&nbsp;&nbsp;" +
day + " " + mnt[d.getMonth()] + " " + d.getFullYear() + " г.");
}
$(document).ready(function () {
clock()
setInterval("clock()", 1000);
});