title: Automatically stamp username who made changes to Google Sheet
body: <p>I have a Google Sheet that I would like to automatically stamp the username of the person who last made a change to a specific row. I currently have this code to work as I like to do the same function with the time:</p>
  
  <pre><code>function onEdit() {
    var s = SpreadsheetApp.getActiveSheet();
    var r = s.getActiveCell();
    if( r.getColumn() != 2 ) { //checks the column
      var row = r.getRow();
      var time = new Date();
      time = Utilities.formatDate(time, "GMT-07:00", "yyyy-MM-dd, hh:mm:ss");
      SpreadsheetApp.getActiveSheet().getRange('G' + row.toString()).setValue(time);
    };
   };
  </code></pre>
  
  <p>Assuming this is somewhat close to what I require for the username, I tried using this:</p>
  
  <pre><code>function onEdit() {
    var s = SpreadsheetApp.getActiveSheet();
    var r = s.getActiveCell();
    if( r.getColumn() != 2 ) { //checks the column
      var row = r.getRow();
      var time = new Date();
      time = Utilities.formatDate(time, "GMT-07:00", "yyyy-MM-dd, hh:mm:ss");
      SpreadsheetApp.getActiveSheet().getRange('H' + row.toString()).setValue(Session.getActiveUser);
    };
   };
  </code></pre>
  
  <p>But that spits out some weird command that is clearly broken.</p>
  
  <p>How can I do this? </p>
  
  <p>This is the sheet I am working on: <a href="https://docs.google.com/spreadsheets/d/1VifU8AJWuPn53-_JCQKbPTjHxKDArkyG0G7zt1wzmPg/edit?usp=sharing" rel="nofollow">https://docs.google.com/spreadsheets/d/1VifU8AJWuPn53-_JCQKbPTjHxKDArkyG0G7zt1wzmPg/edit?usp=sharing</a></p>