12/24 saat yazdırma

Javascript 12/24 saat yazdırma Programlama Dilleri hakkında bilgi paylaş; HTML-Kodu: <!-- Paste this code into the CSS section of your HTML document --> table.clock { text-align: center; ...
Cevapla
 
Seçenekler
  #1  
Arama 25-11-2007, 11:27
banias - ait Kullanıcı Resmi (Avatar)
Pseudo Coder
Üyelik Tarihi: 23/08/07
Mesajlar: 1.177
 
     WS-Ticareti: (2)
Blog Yazıları: 2
Teşekkürleri: 9
100 Msg. 180 Tşkr.
Rep Gücü: 100 banias has much to be proud ofbanias has much to be proud ofbanias has much to be proud ofbanias has much to be proud ofbanias has much to be proud ofbanias has much to be proud ofbanias has much to be proud ofbanias has much to be proud of

12/24 saat yazdırma

HTML-Kodu:
<!-- Paste this code into the CSS section of your HTML document  -->

table.clock {
  text-align: center;
  border: thin dotted blue;
  padding: 5px;
  margin: auto;
}

td, input.clock2 {
  text-align: center;
  border: none;
  font: bold .9em verdana, helvetica, arial, sans-serif;
  padding-bottom: .5em;
}

.clock3 {
  text-align: center;
  font: .7em verdana, arial, helvetica, ms sans serif;
}



<!-- Paste this code into an external JavaScript file named: timeFormat.js  -->

/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Sandeep Gangadharan :: http://www.sivamdesign.com/scripts/ */

function formatTime() {
  now = new Date();
  hour = now.getHours();
  min = now.getMinutes();
  sec = now.getSeconds();

  if (document.clock.sivamtime[0].checked) {
    if (min <= 9) {
      min = "0" + min;
    }
    if (sec <= 9) {
      sec = "0" + sec;
    }
    if (hour > 12) {
      hour = hour - 12;
      add = " p.m.";
    } else {
      hour = hour;
      add = " a.m.";
    }
    if (hour == 12) {
      add = " p.m.";
    }
    if (hour == 00) {
      hour = "12";
    }

    document.clock.sivam.value = ((hour<=9) ? "0" + hour : hour) + ":" + min + ":" + sec + add;
  }

  if (document.clock.sivamtime[1].checked) {
    if (min <= 9) {
      min = "0" + min; }
    if (sec <= 9) {
      sec = "0" + sec; }
    if (hour < 10) {
      hour = "0" + hour; }
    document.clock.sivam.value = hour + ':' + min + ':' + sec;
  }

  setTimeout("formatTime()", 1000);
}

window.onload=formatTime;



<!-- Paste this code into the HEAD section of your HTML document.
     You may need to change the path of the file.  --> <script type="text/javascript" src="timeFormat.js"></script> <!-- Paste this code into the BODY section of your HTML document  --> <form name="clock"> <table class="clock" width="135"> <tr> <td class="clock2">
    Local Time
  </td> </tr> <tr> <td> <input class="clock2" type="text" name="sivam" size="12"><br> </td> </tr> <tr> <td> <label class="clock3" for="1"><input type="radio" id="1" name="sivamtime" checked>12 Hour Format</label><br> <label class="clock3" for="2"><input type="radio" id="2" name="sivamtime">24 Hour Format</label> </td> </tr> </table> </form> <p><div align="center"> <font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font> </div><p> 
__________________
| | |
| |
|
|
|
Alıntı ile Cevapla
Cevapla
Arama Etiketleri: , ,



Seçenekler


Benzer Konular
Konu Konu Açanlar Forum Cevaplar Güncel Mesajlar
Ters yazı yazdırma Miliotta Php kodları 0 12-03-2008 02:50
ingilizce tarih yazdırma banias Javascript kodları 2 31-01-2008 12:26
title da saat dinamik saat görünsün banias Javascript kodları 0 26-11-2007 12:31
12/24 saat yazdırma (2) banias Javascript kodları 0 25-11-2007 11:55
Yazdırma Sorun Gidericisi, Windows XP'de yazdırma sorunları kadınca İşletim Sistemleri 0 23-11-2007 12:00


Webmaster web tasarım online reviews ~ Kadınlar blogu ~ Apple iPhone, iPod Touch ( iTouch ) Forum ~ iPhone