title: Timestamp Date & Time Format - Apps Script - Format Date and Time
body: <p>I can't get the time-stamp format in a spreadsheet cell to also include the time.  Currently, it only produces the date.  What do I need to change to get the time-stamp to show both date and time? </p>
  
  <p>Like this: </p>
  
  <p>3/17/2015 10:57:45</p>
  
  <pre><code>function onEdit(event)
  {
    var ss = event.source.getActiveSheet();
    var r = event.source.getActiveRange();
    if(r.getColumn() == 8){ //To check if update cell in Column, 1 means first column.
      if(r.getValue() == "Resolved"){ //To check the value is equal to Resolved
        ss.getRange('L'+r.getRow()).setValue(new Date()); //Set column B1 value to current date.
        date = Utilities.formatDate(time, "GMT", "HH:mm:ss");
      }else{
        ss.getRange('L'+r.getRow()).setValue('');
      }
    }
  </code></pre>