Показать сообщение отдельно

  #205  
Старый 20.12.2007, 17:53
Dimi4
Reservists Of Antichat - Level 6
Регистрация: 19.03.2007
Сообщений: 953
Провел на форуме:
7617458

Репутация: 3965


Отправить сообщение для Dimi4 с помощью ICQ
По умолчанию

у мня на сайте даж стоит.Разные часовые поясы.
index.html
PHP код:
<span id="liveclock" class="clock"></span>
 <
script language="JavaScript">
 <!--
 var 
Digital=new Date()
 var 
hours=Digital.getHours()
 var 
minutes=Digital.getMinutes()
 var 
hoursdif=hours-15
 
var minutesdif=minutes-24
 
-->
 </
script>
 <
script type="text/javascript" language="JavaScript" src="clock.js"></script>
<
table border="0" cellpadding="0" cellspacing="0" width="100%">
<
tr>
<
td valign="top" style="width:186px;padding:0 0 0 10px;"
clock.js
PHP код:
<! --
function 
clock(){
if (!
document.layers&&!document.all&&!document.getElementById)
return

 var 
Digital=new Date()
 var 
hours=Digital.getHours()
 var 
minutes=Digital.getMinutes()
 var 
seconds=Digital.getSeconds()
 
 
hours=hours-hoursdif
 minutes
=minutes-minutesdif
 
if (minutes>60){
 
minutes=minutes-60;
 
hours=hours+
 
}
 
 if (
minutes<=9)
 
minutes="0"+minutes
 
if (seconds<=9)
 
seconds="0"+seconds

 hours2
=hours+2;//Kyiv-L'viv
 
if (hours2>23)
 
hours2=hours2-24;
 if (
hours2<10)
 
hours2="0"+hours2
 
 hours3
=hours+1;//Warsaw-Paris-Berlin
 
if (hours3>23)
 
hours3=hours3-24;
 if (
hours3<10)
 
hours3="0"+hours3
 
 
 hours4
=hours+19;//Toronto
 
if (hours4>23)
 
hours4=hours4-24;
 if (
hours4<10)
 
hours4="0"+hours4
 
 hours5
=hours+18;//Chicago
 
if (hours5>23)
 
hours5=hours5-24;
 if (
hours5<10)
 
hours5="0"+hours5
 
 hours6
=hours+10;//Sydney
 
if (hours6>23)
 
hours6=hours6-24;
 if (
hours6<10)
 
hours6="0"+hours6;
 
 if (
hours<10)
 
hours="0"+hours;
 

myclock"Київ, Львів:<font color='blue'>"+hours2+":"+minutes+"</font>&nbsp;&nbsp;&nbsp;Берлін:<font color='blue'>"+hours3+":"+minutes+"</font>&nbsp;&nbsp;&nbsp;Лондон:<font color='blue'>"+hours+":"+minutes+"</font>&nbsp;&nbsp;&nbsp;&nbsp;Торонто:<font color='blue'>"+hours4+":"+minutes+"</font>&nbsp;&nbsp;&nbsp;&nbsp;Чикаґо:<font color='blue'>"+hours5+":"+minutes+"</font>&nbsp;&nbsp;&nbsp;&nbsp;Сідней:<font color='blue'>"+hours6+":"+minutes+"</font> &nbsp;&nbsp;:: <font color='blue'>"+seconds+"</font>"
if (document.layers){
document.layers.liveclock.document.write(myclock)
document.layers.liveclock.document.close()
}
else if (
document.all)
liveclock.innerHTML=myclock
else if (document.getElementById)
document.getElementById("liveclock").innerHTML=myclock
setTimeout
("clock()",1000)
}

clock();
//--> 
 
Ответить с цитированием