Arşiv Anasayfa Html & Css & Tcp/Ip,Asp, Php...
Sayfalar: 1
Html'de Status barda Tarih ve Saat By: MaLi Date: 02 January 2008, 18:21:18
:  
<script language="JavaScript">
var timerID = null;
var timerRunning = false;
function startclock ()
{
stopclock();
time();
}
function stopclock ()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
window.status = ""
}
function time ()
{
var now = new Date();
var yr = now.getYear();
var mName = now.getMonth() + 1;
var dName = now.getDay() + 1;
var dayNr = ((now.getDate()<10) ? "0" : "")+ now.getDate();
var ampm = (now.getHours() >= 12) ? " A.M"
: " P.M"
var hours = now.getHours();
hours = ((hours > 12) ? hours - 12 : hours);
var minutes = ((now.getMinutes() < 10) ? ":0" : ":") + now.getMinutes();
var seconds = ((now.getSeconds() < 10) ? ":0" : ":") + now.getSeconds();
if(dName==1) Day = "Pazar";
if(dName==2) Day = "Pazartesi";
if(dName==3) Day = "Salı";
if(dName==4) Day = "Çarşamba";
if(dName==5) Day = "Perşembe";
if(dName==6) Day = "Cuma";
if(dName==7) Day = "Cumartesi";
if(mName==1) Month="Ocak";
if(mName==2) Month="Şubat";
if(mName==3) Month="Mart";
if(mName==4) Month="Nisan";
if(mName==5) Month="Mayıs";
if(mName==6) Month="Haziran";
if(mName==7) Month="Temmuz";
if(mName== Month="Ağustos";
if(mName==9) Month="Eylül";
if(mName==10) Month="Ekim";
if(mName==11) Month="Kasım";
if(mName==12) Month="Aralık";
// String to display current date.
var DayDateTime=(" "
+ dayNr
+ " "
+ Month
+ " "
+ "19"
+ yr
+ ", "
+ Day
+ " // Saat: "
+ hours
+ minutes
+ seconds
+ " "
+ ampm
);
window.status=DayDateTime;
timerID = setTimeout("time()",1000);
timerRunning = true;
}
function clearStatus()
{
if(timerRunning)
clearTimeout(timerID);
timerRunning = false;
window.status=" ";
}
// -- End Hiding Here -->
</script>