Home  >  Article  >  Web Front-end  >  JS 两个字符串时间的天数差计算_javascript技巧

JS 两个字符串时间的天数差计算_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:24:22995browse

JS 两个字符串时间的天数差

复制代码 代码如下:

var s = ((new Date(paramObj.end_date.replace(/-/g,"\/"))) - (new Date(paramObj.start_date.replace(/-/g,"\/"))));
var day = s/1000/60/60/24
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn