Sets the UTC date's hours

Description

setUTCHours(hours)
Sets the UTC date's hours. Setting the hours to a number greater than 23 also increments the day of the month.

Example


      var myDate = new Date();
      //  ww w . j a v  a2 s. c o m
      myDate.setUTCHours(1);
      console.log(myDate.toString());
      

The code above generates the following result.





















Home »
  Javascript »
    Javascript Reference »




Array
Canvas Context
CSSStyleDeclaration
CSSStyleSheet
Date
Document
Event
Global
History
HTMLElement
Input Element
Location
Math
Number
String
Window