How can get DateTime by using of javascript ?

Total Post:51

Points:255
 423  View(s)
Ratings:
Rate this:
  1. Post:51

    Points:255
    How can get DateTime by using of javascript ?

    This is the smallest program in javascript for getting DateTime.

    <!DOCTYPE html>
    
    <html>
    <body>

    <h2>My First JavaScript</h2>

    <button type="button" onclick="document.getElementById('demo').innerHTML = Date()">Click me</button>

    <p id="demo"></p>

    </body>
    </html>

Answer