title: how to add a (big)difference between to dates to another date
body: <p>In a Jython script I want to move a date with the same amount an another date is changed. So in my script I get two variables:
  scheduledDate and scheduledDate_previous</p>
  
  <p>Both are java Date objects. I want to apply the difference to another Date: reservationDate</p>
  
  <p>The problem is that with big differences, I get a 'cannot convert to integer'-error on the calendar.add() function. Here's my code:</p>
  
  <pre><code>from java.util import Date
  form java.util import Calendar
  
  myDiff = int(scheduledDate.getTime() - scheduledDate_previous.getTime())
  
  reservationCal = Calendar.getInstance()
  reservationCal.setTime(reservationDate)
  
  reservationCal.add(Calendar.MILLISECOND, myDiff)
  
  reservationDate = reservationCal.getTime()
  </code></pre>
  
  <p>If the difference between two dates becomes to large, the myDiff is no longer an Int, but a Big Int
  (note that it can also be a negative number!)
  So I tried something like this:</p>
  
  <pre><code>reservationCal.add(Calendar.MINUTE, int(myDiff / 60000) )
  </code></pre>
  
  <p>I don't need that insane presicion anyway. But this didn't work all the time. <strong>EDIT</strong> It would result in a 'add(): second arg cant be coerced to an int'-error Which seemed fair since if you had a weird difference the division could result in a float. So I tried this:</p>
  
  <pre><code>from java.lang import Math
  reservationCal.add(Calendar.MINUTE, int(math.floor(myDiff / 60000)))
  </code></pre>
  
  <p>I still get an error like:</p>
  
  <p>TypeError: unsupported operant type(s) for: 'java.math.BigInterger' and 'int'</p>
  
  <p>The weird thing is that I don't get this error when I change the date a few days. It happens when I change it 3 months. User are able to change the date and time. They need to change it within a few years.</p>
  
  <p>due to compatibility issues the machine is still on java 32 bit 1.6.0_25. It uses jython 2.5.2</p>
  
  <p>Is there a solution or do I need different approuch?</p>