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 />

secondsValue : An integer between 0 and 59, representing the seconds. If<br />

you specify the secondsValue parameter, you must also specify the<br />

minutesValue.<br />

msValue : A number between 0 and 999, representing the milliseconds. If<br />

you specify the msValue parameter, you must also specify the minutesValue<br />

and secondsValue.<br />

If you do not specify the secondsValue and msValue parameters, the values<br />

returned from getSeconds and getMilliseconds methods are used.<br />

Try the following example.<br />

<br />

<br />

JavaScript setMinutes Method<br />

<br />

<br />

<br />

var dt = new Date( "Aug 28, 2008 23:30:00" );<br />

dt.setMinutes( 45 );<br />

document.write( dt );<br />

<br />

<br />

<br />

Output<br />

Thu Aug 28 2008 23:45:00 GMT+0530 (India Standard Time)<br />

setMonth ()<br />

Javascript date setMonth() method sets the month for a specified date<br />

according to local time.<br />

Syntax<br />

The following syntax for setMonth () Method.<br />

Date.setMonth(monthValue[, dayValue])<br />

Note: Parameters in the bracket are always optional.<br />

Parameter Detail<br />

249

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

Saved successfully!

Ooh no, something went wrong!