title: AS2: Calculate days between two dates
body: <p>I use this script currently to determine the difference between two dates:</p>
  
  <pre><code>// Slide_Tracker[?].date_int are results from the built in function getTime()
  var current_date = new Date(Slide_Tracker[i].date_int);
  var past_date:Date = new Date(Slide_Tracker[i - 1].date_int);
  var date_diff:Number = Math.round((current_date - past_date) / 86400000);
  </code></pre>
  
  <p>The problem with this is I want to monitor the actual physical day change so if someone accessed the application at 11:59 PM and then came back 5 minutes later this would register as a 1 day difference (a new day), this current script requires atleast 12 hours to have passed between two dates for it to register as a new day.</p>
  
  <p>I have thought about using the date number etc, but because months and years are so different it is quite a complex route, there must be something simpler.</p>