Date.prototype.compare(date, absolute)

Description:

Add specified hours to the date value.

Parameters:

  • date
    • Type: Date
  • absolute
    • Type: boolean (Optional)

Returned Value:

  • Offset calculated

Sample:

var date1 = new Date(2012, 4, 2, 18, 01, 03);
var date2 = new Date(2012, 4, 3, 13, 02, 16);
document.write(date1.compare(date2));
//Result: -68473000
document.write(date1.compare(date2, true));
//Result: 68473000

Last edited Aug 20, 2012 at 7:36 AM by rynnwang, version 2

Comments

No comments yet.