Wily_Fox
دوشنبه 27 خرداد 1392, 18:33 عصر
با سلام وخسته نباشید
کدی که در زیر نوشتم آیا ساعت سرور رو نمایش میده یا اینکه ساعت کامپیوتر کلاینت رو؟
<script>
$(document).ready(function () {
GetClock();
});
function GetClock() {
var time = new Date();
$("#timenow").text(((time.getHours() < 10) ? "0" : "") + time.getHours() +
":" + ((time.getMinutes() < 10) ? "0" : "") + time.getMinutes() +
":" + ((time.getSeconds() < 10) ? "0" : "") + time.getSeconds());
setTimeout("GetClock()", 1000);
}
</script>
متشکرم
کدی که در زیر نوشتم آیا ساعت سرور رو نمایش میده یا اینکه ساعت کامپیوتر کلاینت رو؟
<script>
$(document).ready(function () {
GetClock();
});
function GetClock() {
var time = new Date();
$("#timenow").text(((time.getHours() < 10) ? "0" : "") + time.getHours() +
":" + ((time.getMinutes() < 10) ? "0" : "") + time.getMinutes() +
":" + ((time.getSeconds() < 10) ? "0" : "") + time.getSeconds());
setTimeout("GetClock()", 1000);
}
</script>
متشکرم