10.07.2017 Views

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

JavaScript setYear Method<br />

<br />

<br />

<br />

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

dt.setYear( 2000 );<br />

document.write( dt );<br />

<br />

<br />

<br />

Output<br />

Mon Aug 28 2000 13:30:00 GMT+0530 (India Standard Time)<br />

toDateString ()<br />

Javascript date toDateString() method returns the date portion of a Date<br />

object in human readable form.<br />

Syntax<br />

Its syntax is as follows:<br />

Date.toDateString()<br />

Return Value<br />

Returns the date portion of a Date object in human readable form.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript toDateString Method<br />

<br />

<br />

<br />

261

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

Saved successfully!

Ooh no, something went wrong!