Enter current date into a cell when another cell is changed

The other answer started with a good idea but unfortunately the suggested code does not work because it has many basic errors (obviously it wasn't tested ...)

So here is a version that simply works :

function onEdit(e) {
  var sheet      = e.source.getActiveSheet();
  var activeCell = sheet.getActiveCell();
  var col        = activeCell.getColumn();
  var row        = activeCell.getRow();
  if (col == 2 ) { // assuming status is in column 2, adapt if needed
    sheet.getRange(row, col+1).setValue(new Date()).setNumberFormat('MMM dd yyyy');// change the display format to your preference here
  }
}