10.07.2017 Views

javascript_tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Javascript<br />

Date()<br />

Javascript Date() method returns today's date and time and does not need any<br />

object to be called.<br />

Syntax<br />

Its syntax is as follows:<br />

Date()<br />

Return Value<br />

Returns today's date and time.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript Date Method<br />

<br />

<br />

<br />

var dt = Date();<br />

document.write("Date and Time : " + dt );<br />

<br />

<br />

<br />

Output<br />

Date and Time : Wed Mar 25 2015 15:00:57 GMT+0530 (India Standard Time)<br />

getDate()<br />

Javascript date getDate() method returns the day of the month for the<br />

specified date according to local time. The value returned by getDate is an<br />

integer between 1 and 31.<br />

227

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!