Home >Web Front-end >JS Tutorial >JS calculation of the difference in days between two string times_javascript skills

JS calculation of the difference in days between two string times_javascript skills

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

JS The difference in days between two string times

Copy code The code is as follows:

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