NEPAL | ARTICLES | KAVITAHARU | MANTHAN | COOL LINKS | GUESTBOOK | SEARCH |
|||
JAVASCRIPT NEPAL KAVITAHARU ARTICLES COOL LINKS ADD EMAIL GUESTBOOK KURAKANI FREE E-CARDS FREE SITE SUBMIT
ABOUT ME
|
| ||
DATE:a predefined object: But if you want the current date and time in your own style here is the example. <script language="JavaScript"> <!-- Hide from older browser var x= new Date() var y= x.getYear() var m= x.getMonth()+1 // added +1 because javascript counts month from 0 var d= x.getDate() var h= x.getHours() var mi= x.getMinutes() var s= x.getSeconds() document.write("Today's date is: ") document.write(m+'/'+d+'/'+y+' '+h+'.'+mi+'.'+s) //--> </script> This is the example of a CLOCK <TABLE BORDER=1 BGCOLOR=LIGHTGREEN> <TH>JavaScript's CLOCK </TH><TR><TD> <FORM NAME="NCT3"> <INPUT TYPE=TEXT NAME="time" SIZE=25 > </FORM> <SCRIPT LANGUAGE="JavaScript"> <!-- Hide from older browser function myClock(){ myTime = new Date(); document.NCT3.time.value = " "+myTime; document.NCT3.time.blur(); setTimeout("myClock()", 1000); } myClock(); //--> </SCRIPT> </TD></TR> </TABLE>
Cut & Paste JavaScript |
Home
| About Me
| Nepal
| Articles
| Kavitaharu
| Cool Links
Javascript | Add Email | Guestbook |