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

Date.toLocaleTimeString ()<br />

Return Value<br />

Returns the formatted date in a string fromat.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript toLocaleTimeString Method<br />

<br />

<br />

<br />

var dt = new Date(1993, 6, 28, 14, 39, 7);<br />

document.write( "Formated Date : " + dt.toLocaleTimeString() );<br />

<br />

<br />

<br />

Output<br />

Formated Date : 2:39:07 PM<br />

toSource ()<br />

This method returns a string representing the source code of the object.<br />

Note: This method may not be compatible with all the browsers.<br />

Syntax<br />

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

Date.toSource ()<br />

Return Value<br />

For the built-in Date object, toSource returns a string (new<br />

Date(...))indicating that the source code is not available<br />

267

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

Saved successfully!

Ooh no, something went wrong!