I have two input dates taking from Date Picker control.
(我有两个输入日期来自Date Picker控件。)
I have selected start date 2/2/2012 and end date 2/7/2012.(我选择了开始日期2/2/2012和结束日期2/7/2012。)
I have written following code for that.(我为此编写了以下代码。)
I should get result as 6 but I am getting 5.
(我应该得到6的结果,但我却得到5。)
function SetDays(invoker) {
var start = $find('<%=StartWebDatePicker.ClientID%>').get_value();
var end = $find('<%=EndWebDatePicker.ClientID%>').get_value();
var oneDay=1000 * 60 * 60 * 24;
var difference_ms = Math.abs(end.getTime() - start.getTime())
var diffValue = Math.round(difference_ms / oneDay);
}
Can anyone tell me how I can get exact difference?
(谁能告诉我如何获得确切的区别?)
ask by Vaibhav Deshmukh translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…