10.02.2018 Views

js_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Javascript<br />

<br />

<br />

JavaScript getYear Method<br />

<br />

<br />

<br />

var dt = new Date();<br />

document.write("getYear() : " + dt.getYear() );<br />

<br />

<br />

<br />

Output<br />

getYear() : 115<br />

setDate ()<br />

Javascript date setDate() method sets the day of the month for a specified date<br />

according to local time.<br />

Syntax<br />

Its syntax is as follows:<br />

Date.setDate( dayValue )<br />

Parameter Detail<br />

dayValue : An integer from 1 to 31, representing the day of the month.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript setDate Method<br />

<br />

<br />

<br />

244

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

Saved successfully!

Ooh no, something went wrong!