Search for the Article

How to Get Current Date & Time in JavaScript

In this example, I will demonstrate how to write a JavaScript program that displays today's date, time and timezone.

The new Date().toString(); method returns a string of the form yyyy-mm-dd like this ..
Month Date Year HR:MM:SS (IST)
Today Date is:

function() {
    var a= new Date().toString();
    return a;
  }