Javascript comparing current date to a timestamp
<p>I'm using the Scala Play framework and I have a form that lets a user search for records, they can then search using today's date and a time stamp <code>2016-12-17T09:26:47.676Z</code> to create a search range. Note that I mean a 24 hour period, as a single day is usually defined, and not as a difference in a date definition.</p>

<p>I don't have any experience with Javascript, I'd like to compare today's date with this time stamp, calculate the difference in days, and then return the amount of whole <code>days</code> between the two time stamps e.g if the two timestamps had 48 hours difference then it would return <code>2</code> days.</p>

<p>I can declare the search time stamp in the <code>script</code> tag on the HTML page, but I would like to know how to call today's date, do some logic to calculate the difference between the dates <code>DaysDifference</code>, and then call this variable in a link on the page: </p>

<p><code>&lt;a target="_blank" href="@baseLogsUrl/#/discover?_g=(time:(from:no@DaysDifference/d,to:now))&amp;_a=(query:(query_string:(query:'@data._id')))"&gt;</code></p>