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

<br />

<br />

var dt = new Date( "December 25, 1995 23:15:20" );<br />

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

<br />

<br />

<br />

Output<br />

getUTCFullYear() : 1995<br />

getUTCHours ()<br />

Javascript date getUTCHours() method returns the hours in the specified date<br />

according to universal time. The value returned by getUTCHours is an integer<br />

between 0 and 23.<br />

Syntax<br />

Its syntax is as follows:<br />

Date.getUTCHours ()<br />

Return Value<br />

Returns the hours in the specified date according to universal time.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript getUTCHours Method<br />

<br />

<br />

<br />

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

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

<br />

239

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

Saved successfully!

Ooh no, something went wrong!