Last active
September 13, 2016 02:34
-
-
Save Stephen-Cronin/dfe31f17f01528c2bf1b363cba4eb4d6 to your computer and use it in GitHub Desktop.
Last Updated Column in Google Spreadsheets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onEdit() { | |
var s = SpreadsheetApp.getActiveSheet(); | |
var r = s.getActiveCell(); | |
if( r.getColumn() != 2 && r.getRow() != 1 ) { //checks the column | |
var row = r.getRow(); | |
var time = new Date(); | |
var timezone = CalendarApp.getDefaultCalendar().getTimeZone(); | |
time = Utilities.formatDate(time, timezone, "dd/MM/yyyy, hh:mm:ss"); | |
SpreadsheetApp.getActiveSheet().getRange('B' + row.toString()).setValue(time); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uses code from http://webapps.stackexchange.com/questions/37408/auto-updating-column-in-google-spreadsheet-showing-last-modify-date
I added the timezone code found on that page, moved it to Australian date format and also modified it to ignore changes to the header row