title: CRM 2011 JavaScript - Modify Date From One Field And Set To Another
body: <p>I am trying to pull out a date from one field, modify that date and set that value into another, here is my code:</p>
  
  <pre><code>var startDate = Xrm.Page.getAttribute('new_startdate').getValue();
  var expiryDate = startDate.getDate()+3; //Add 3 days
  
  var expiryField = Xrm.Page.getAttribute('new_expirydate').setValue(expiryDate);
  </code></pre>
  
  <p>Can someone explain what I'm doing wrong?  I've been at this for a while now and I fear I'm missing something blatently obvious..</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT;</p>
  
  <p>When the script fires, 1/1/1970 is set in the expiry field.</p>