Saat & tarih kodları

Son güncelleme: 23.09.2010 21:47
  • Saat & tarih kodları

    <BODY onLoad="clock()">

    <!--Aşağıdaki kodu sayfanızın Body'sine yerleştiriniz-->

    <!-- Adjust the placement of the clock in the line below -->
    <span id="pendule" style="position:absolute;left:300;top:20;"></span>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    function clock() {
    if (!document.layers && !document.all) return;
    var digital = new Date();
    var hours = digital.getHours();
    var minutes = digital.getMinutes();
    var seconds = digital.getSeconds();
    var amOrPm = "AM";
    if (hours > 11) amOrPm = "PM";
    if (hours > 12) hours = hours - 12;
    if (hours == 0) hours = 12;
    if (minutes <= 9) minutes = "0" + minutes;
    if (seconds <= 9) seconds = "0" + seconds;
    dispTime = hours + ":" + minutes + ":" + seconds + " " + amOrPm;
    if (document.layers) {
    document.layers.pendule.document.write(dispTime);
    document.layers.pendule.document.close();
    }
    else
    if (document.all)
    pendule.innerHTML = dispTime;
    setTimeout("clock()", 1000);
    }
    // End -->
    </script>

    Buton saat


    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    day = new Date();
    miVisit = day.getTime();
    function clock() {
    dayTwo = new Date();
    hrNow = dayTwo.getHours();
    mnNow = dayTwo.getMinutes();
    scNow = dayTwo.getSeconds();
    miNow = dayTwo.getTime();
    if (hrNow == 0) {
    hour = 12;
    ap = " AM";
    } else if(hrNow <= 11) {
    ap = " AM";
    hour = hrNow;
    } else if(hrNow == 12) {
    ap = " PM";
    hour = 12;
    } else if (hrNow >= 13) {
    hour = (hrNow - 12);
    ap = " PM";
    }
    if (hrNow >= 13) {
    hour = hrNow - 12;
    }
    if (mnNow <= 9) {
    min = "0" + mnNow;
    }
    else (min = mnNow)
    if (scNow <= 9) {
    secs = "0" + scNow;
    } else {
    secs = scNow;
    }
    time = hour + ":" + min + ":" + secs + ap;
    document.form.button.value = time;
    self.status = time;
    setTimeout('clock()', 1000);
    }
    function timeInfo() {
    milliSince = miNow;
    milliNow = miNow - miVisit;
    secsVisit = Math.round(milliNow / 1000);
    minsVisit = Math.round((milliNow / 1000) / 60);
    alert("There have been " + milliSince + " milliseconds since midnight, January 1, 1970. "
    + "You have spent " + milliNow + " of those milliseconds on this page. "
    + ".... About " + minsVisit + " minutes, and "
    + secsVisit + " seconds.");
    }
    document.write("<form name=\"form\">"
    + "<input type=button value=\"Click for info!\""
    + " name=button onClick=\"timeInfo()\"></form>");
    onError = null;
    clock();
    // End -->
    </SCRIPT>

    Tarih

    <SCRIPT LANGUAGE="JavaScript1.2">

    <!-- Begin
    var months=new Array(13);
    months[1]="Ocak";
    months[2]="?ubat";
    months[3]="Mart";
    months[4]="Nisan";
    months[5]="Mayys";
    months[6]="Haziran";
    months[7]="Temmuz";
    months[8]="A?ustos";
    months[9]="Eylül";
    months[10]="Ekim";
    months[11]="Kasym";
    months[12]="Aralyk";
    var time=new Date();
    var lmonth=months[time.getMonth() + 1];
    var date=time.getDate();
    var year=time.getYear();
    if (year < 2000) // Y2K Fix, Isaac Powell
    year = year + 1900; // http://onyx.idbsu.edu/~ipowell
    document.write("<center>" + lmonth + " ");
    document.write(date + ", " + year + "</center>");
    // End -->
    </SCRIPT>
    </CENTER>



    --------------------------------------------------------------------------------

    Dijital saat

    <!--Üç adımda dijital saat::

    1.Sayfanızın HEAD kısmına kopyalayın
    2. onLoad event BODY tag
    3. Sayfanızın BODY sine kopyalayın-->

    <!-- Birinci adım:Sayfanızın HEAD kısmına kopyalayın-->

    <HEAD>

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    var dn;
    c1 = new Image(); c1.src = "digital-clock/c1.gif";
    c2 = new Image(); c2.src = "digital-clock/c2.gif";
    c3 = new Image(); c3.src = "digital-clock/c3.gif";
    c4 = new Image(); c4.src = "digital-clock/c4.gif";
    c5 = new Image(); c5.src = "digital-clock/c5.gif";
    c6 = new Image(); c6.src = "digital-clock/c6.gif";
    c7 = new Image(); c7.src = "digital-clock/c7.gif";
    c8 = new Image(); c8.src = "digital-clock/c8.gif";
    c9 = new Image(); c9.src = "digital-clock/c9.gif";
    c0 = new Image(); c0.src = "digital-clock/c0.gif";
    cb = new Image(); cb.src = "digital-clock/cb.gif";
    cam = new Image(); cam.src = "digital-clock/cam.gif";
    cpm = new Image(); cpm.src = "digital-clock/cpm.gif";
    function extract(h,m,s,type) {
    if (!document.images) return;
    if (h <= 9) {
    document.images.a.src = cb.src;
    document.images.b.src = eval("c"+h+".src");
    }
    else {
    document.images.a.src = eval("c"+Math.floor(h/10)+".src");
    document.images.b.src = eval("c"+(h%10)+".src");
    }
    if (m <= 9) {
    document.images.d.src = c0.src;
    document.images.e.src = eval("c"+m+".src");
    }
    else {
    document.images.d.src = eval("c"+Math.floor(m/10)+".src");
    document.images.e.src = eval("c"+(m%10)+".src");
    }
    if (s <= 9) {
    document.g.src = c0.src;
    document.images.h.src = eval("c"+s+".src");
    }
    else {
    document.images.g.src = eval("c"+Math.floor(s/10)+".src");
    document.images.h.src = eval("c"+(s%10)+".src");
    }
    if (dn == "AM") document.j.src = cam.src;
    else document.images.j.src = cpm.src;
    }
    function show3() {
    if (!document.images)
    return;
    var Digital = new Date();
    var hours = Digital.getHours();
    var minutes = Digital.getMinutes();
    var seconds = Digital.getSeconds();
    dn = "AM";
    if ((hours >= 12) && (minutes >= 1) || (hours >= 13)) {
    dn = "PM";
    hours = hours-12;
    }
    if (hours == 0)
    hours = 12;
    extract(hours, minutes, seconds, dn);
    setTimeout("show3()", 1000);
    }
    // End -->
    </script>

    </HEAD>

    <!-- İkinci adım:Sayfanızın BODY tagleri arasına onload event ekleyin-->


    <BODY onLoad="show3()" bgcolor="#000000">

    <!-- Üçüncü adım:sayfanızın BODY'sine ekleyin-->

    <img height=21 src="digital-clock/cb.gif" width=16 name=a>
    <img height=21 src="digital-clock/cb.gif" width=16 name=b>
    <img height=21 src="digital-clock/colon.gif" width=9 name=c>
    <img height=21 src="digital-clock/cb.gif" width=16 name=d>
    <img height=21 src="digital-clock/cb.gif" width=16 name=e>
    <img height=21 src="digital-clock/colon.gif" width=9 name=f>
    <img height=21 src="digital-clock/cb.gif" width=16 name=g>
    <img height=21 src="digital-clock/cb.gif" width=16 name=h>
    <img height=21 src="digital-clock/cam.gif" width=16 name=j>

    Sitende farenin kordinatına bak

    <script>
    var weite=document.body.clientWidth-2;
    var hoehe=document.body.clientHeight-2;
    document.write('<div id="leftright" style="position:absolute;left:0; top:0; width:1px; height:1px; z-index:100; font-size:1px; width:expression(document.body.clientWidth-2)"><table cellpadding=0 cellspacing=0 border=0 width=100% height=1><tr><td bgcolor=red></td><tr></table> </div>');
    document.write('<div id="topdown" style="position:absolute;left:0;top:0;width:1px;he ight:1px; z-index:100;height:expression(document.body.clientHe ight-2)"><table cellpadding=0 cellspacing=0 border=0 width=1 height=100%><tr><td bgcolor=red></td></tr></table></div>');

    if (document.all){
    leftright.style.width=document.body.clientWidth-2;
    topdown.style.height=document.body.clientHeight-2;
    }
    else if (document.layers){
    document.leftright.clip.width=window.innerWidth
    document.leftright.clip.height=1
    document.topdown.clip.width=1
    document.topdown.clip.height=window.innerHeight
    }

    function followmouse1(){
    //move cross engine for IE 4+
    leftright.style.pixelTop=document.body.scrollTop+e vent.clientY+1
    topdown.style.pixelTop=document.body.scrollTop
    if (event.clientX<document.body.clientWidth-2)
    topdown.style.pixelLeft=document.body.scrollLeft+e vent.clientX+1
    else
    topdown.style.pixelLeft=document.body.clientWidth-2
    }
    function followmouse2(e){
    //move cross engine for NS 4+
    document.leftright.top=e.y+1
    document.topdown.top=pageYOffset
    document.topdown.left=e.x+1
    }
    if (document.all)
    document.onmousemove=followmouse1
    else if (document.layers){
    window.captureEvents(Event.MOUSEMOVE)
    window.onmousemove=followmouse2
    }
    function regenerate(){
    window.location.reload()
    }
    function regenerate2(){
    setTimeout("window.onresize=regenerate",400)
    }
    if ((document.all&&!window.print)||document.layers)
    //if the user is using IE 4 or NS 4, both NOT IE 5+
    window.onload=regenerate2
    </script>
#05.01.2010 09:52 0 0 0
  • Tşkler Emeginize SağLık
#14.02.2010 17:08 0 0 0
  • Bir Demet Teşekkür Sana :D
#14.02.2010 17:14 0 0 0
  • tşkler
#23.09.2010 21:47 0 0 0