Tutorialsplane

How to get current date in javascript

How to get current date in javascript :

You get current date in javascript using the Date() function which returns the current date as per your timestamp.

Get current date in javascript



<title>Javascript Date Time Demo</title>


<div id="demoDate"></div>



Try it »

Displaying Dates In Javascript :

Using .toUTCstring() It converts date in UTC String(a standard format to date display)

Display Date in UTC Standard In Javascript



<title>Javascript Date Time Demo</title>


<div id="demoDate"></div>



Try it »

Using .toDatestring() It converts date in user friendly date format.

Display Date in DateString Standard In Javascript



<title>Javascript Date Time Demo</title>


<div id="demoDate"></div>



Try it »