Created
June 20, 2014 20:12
-
-
Save ajot/88ca5377cbde7963c552 to your computer and use it in GitHub Desktop.
Get Last Updated Date - Google Spreadsheet
This file contains hidden or 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() { | |
| Logger.log("Starting"); | |
| var email = Session.getEffectiveUser().getEmail(); | |
| Logger.log(email); | |
| // Getting the Current Spreadsheet | |
| var s = SpreadsheetApp.getActiveSheet(); | |
| var r = s.getActiveCell(); //Getting the active cell | |
| if( r.getColumn() != 2 ) { //checks the column | |
| if( r.getRow() != 1 ) { //Excluding the header | |
| var row = r.getRow(); | |
| // var time = new Date(); | |
| // time = Utilities.formatDate(time, "GMT-08:00", "MM/DD/yy"); | |
| var formattedDate = Utilities.formatDate(new Date(),"GMT-04:00","MM-dd-yyyy 'at' HH:mm:ss z"); | |
| Logger.log("formattedDate"); | |
| SpreadsheetApp.getActiveSheet().getRange('K' + row.toString()).setValue(formattedDate); //Inserting the date in the cell | |
| // Getting the current user. Needs Auth | |
| var email = Session.getActiveUser().getEmail(); | |
| Logger.log(email); | |
| SpreadsheetApp.getActiveSheet().getRange('E' + row.toString()).setValue(email); | |
| }; | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello
thank You for Your answer. but how to get email receiving date by specific email addresses list to. so all dates could fill the row?