'Date' Example : Date « Javascript Objects « JavaScript DHTML






'Date' Example

 <html> <body> <script language="javascript"> function function1(){ var date = new Date(); alert(date.toString()); } </script> <button onclick="function1();">Today's date</button> </body> </html> 








Related examples in the same category

1.Date.toString()
2.Date.toLocaleString()
3.Date.toLocaleDateString()
4.Date.toLocaleTimeString()
5.Date.toGMTString()
6.Date.toUTCString()
close