IT Process Automation

CA PAM::.Javascript::. getHours() Method 

03-24-2017 09:12 AM

getHours()

 

Overview - definition

 

Returns the hour (from 0-23)

 

Usage

The getHours() method returns the hour (from 0 to 23) representing the hour.

 

 

Results

A Number, from 0 to 23, representing the year

Examples

 

var vDate = new Date();
var vHour = vDate.getHours();

 

var vdate = new Date("March 24, 2017 10:14:13");
var vhour = vdate.getHours();

//the results of vhour will be 10

 

function LeftZero(vtemp) {
    if (vtemp < 10) {
        vtemp = "0" + vtemp;
    }
    return vtemp;
}

function myHour() {

    var vdate = new Date();

    var vhour = LeftZero(vdate.getHours());
    var vminute = LeftZero(vdate.getMinutes());
    var vsecond = LeftZero(vdate.getSeconds());

    var result = vhour + ":" + vminute + ":" + vsecond;
}

 

 

know_more.png

Summary CA Process Automation 

Summary CA Service Management Community 

Service Desk Manager 15 days Implementation 

CABI:: Summary - BOXI for CA SDM 

Summary CA SDM Scoreboard 

 

 

Was useful, please leave your feedback!

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.