Today's Date : Date « Development « JavaScript DHTML

JavaScript DHTML
1. Ajax Layer
2. Data Type
3. Date Time
4. Development
5. Document
6. Event
7. Event onMethod
8. Form Control
9. GUI Components
10. HTML
11. Javascript Collections
12. Javascript Objects
13. Language Basics
14. Node Operation
15. Object Oriented
16. Page Components
17. Security
18. Style Layout
19. Table
20. Utilities
21. Window Browser
Microsoft Office Word 2007 Tutorial
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
JavaScript DHTML » 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>


           
       
Related examples in the same category
1. Demo all methods in Date class
2. how many days Between two dates
3. Display date: day month year in string
4. Date: date, month, and year.
5. Set date: setDate, setHour
6. UTC time: getUTCDate returns the Universal Coordinated Time
7. Display weekday: name of the current day
8. Display full date : complete date with the day name and month name
9. Display time: continues writing time per second.
10. Date: Week of the year
11. Display current date: year, month day in number
12. Extending the Date Object to Include Some New Methods
13. Methods and Properties of the Date Object
14. Using the Date Object
15. Output day
16. A Dynamic Welcome Message
17. How Many Days Until Christmas
18. Summer Games Countdown
19. Simple Date Validation
20. GMT Calculator
21. Days Before Next Christmas Xmas
22. Get how many days before a date
ww_w.java__2_s___._c__om_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.