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
Release: 2016-05-16 17:24:22
Original
1094 people have browsed it

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
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template