Today's Date : Date : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Date »

 

Today's Date




/*
Examples From
JavaScript: The Definitive Guide, Fourth Edition

Legal matters: these files were created by David Flanagan, and are
Copyright (c) 2001 by David Flanagan.  You may use, study, modify, and
distribute them for any purpose.  Please note that these examples are
provided "as-is" and come with no warranty of any kind.

David Flanagan
*/
<html>
<head>
<title>Today's Date</title>
    <script language="JavaScript">
    // Define a function for use later on.
    function print_todays_date() {
        var d = new Date();                  // Get today's date and time
        document.write(d.toLocaleString());  // Insert it into the document
    }
    </script>
</head>
<body>
The date and time are:<br>
<script language="JavaScript">
  // Now call the function we defined above.
  print_todays_date();
</script>
</body>
</html>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Date