title: Converting String to DateTime in SSJS
body: <p>I'm trying to set a default value on an inputText field that has a dateTimeHelper associated with it. The following computed default value works:</p>
  
  <pre><code>return @Today();
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/xbgfy.png" alt="img1"></p>
  
  <p>However, I need to set the default date value 7 days from a date that is stored as a string on a document. So I tried the following:</p>
  
  <pre><code>var date:NotesDateTime = session.createDateTime(doc.getItemValue("EffDate")[0]);
  log.logEvent("date= " + date); // returns 09/01/2013
  
  var newDate = new Date(date);
  log.logEvent("newDate= " + newDate); // returns NaN
  
  var datePlus7 = @Adjust(newDate,0,0,7,0,0,0,"[InLocalTime]");
  log.logEvent("datePlus7= " + datePlus7); // returns NaN
  
  return datePlus7;
  </code></pre>
  
  <p>Which does not work because datePlus7 is NaN. Any ideas are greatly appreciated.</p>