var start, end, diff;
start = new Date(2014, 2, 1); // March 1st 2014
end = new Date(2014, 5, 1); // May 1st 2014
diff = ((end - start) / (1000 * 3600 * 24)) + 1;
// diff won't *quite* be 93, because of the change to DST
// (assuming a timezone where DST changes sometime in
// March, as in most parts of the U.S., UK, and Canada
snippet.log("diff = " + diff + " instead of 93");
snippet.log("rounded = " + Math.round(diff));
// Similarly, at the other end:
start = new Date(2014, 9, 1); // October 1st 2014
end = new Date(2014, 11, 1); // December 1st 2014
diff = ((end - start) / (1000 * 3600 * 24)) + 1;
// diff won't *quite* be 62, because of the change to DST
// (assuming a timezone where DST changes sometime in
// March, as in most parts of the U.S., UK, and Canada
snippet.log("diff = " + diff + " instead of 62");
snippet.log("rounded = " + Math.round(diff));
<!-- Script provides the `snippet` object, see http://meta.stackexchange.com/a/242144/134069 -->
<script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"></script>