Date.prototype.addHours(hours)

Description:

Add specified hours to the date value.

Parameters:

  • hours
    • Type: Number

Returned Value:

  • Value calculated

Notice:

After calling this method, the original variable has been applied the value calculated.

Sample:

var date = new Date(2012, 4, 2, 18, 01, 03);
date.addHours(2);
document.write(date.format("yyyy-MM-dd HH:mm:ss"));
//Result: "2012-05-02 20:01:03"

Last edited Aug 20, 2012 at 7:29 AM by rynnwang, version 1

Comments

No comments yet.