Skip to content

Instantly share code, notes, and snippets.

@dayidp
dayidp / LastUpdatedDateStampSheets
Created February 26, 2015 09:12
Last Updated DateStamp for Google Sheets
/**
* Places a date stamp in column A in the same row that is edited.
* The onEdit() function is automatically invoked whenever the spreadsheet is edited.
* SimpleDateFormat can be referenced:
* http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
*/
function onEdit() {
var a = SpreadsheetApp.getActiveSheet().getActiveCell();
if( a.getColumn() != 1 ) { // if current column does not equal 1st column
time = Utilities.formatDate(new Date(), "GMT-08:00", "MM/dd/yyyy");