Created
July 2, 2024 22:43
-
-
Save amccloud/8ddd67df963206bc28dfe841863b2629 to your computer and use it in GitHub Desktop.
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(e) { | |
const now = new Date(); | |
const utcNow = new Date(Date.UTC( | |
now.getUTCFullYear(), | |
now.getUTCMonth(), | |
now.getUTCDate(), | |
now.getUTCHours(), | |
now.getUTCMinutes(), | |
now.getUTCSeconds(), | |
now.getUTCMilliseconds() | |
)); | |
var sh = e.source.getActiveSheet(); | |
if (sh.getName() == 'Sheet1' && e.range.getColumn() == 1 && e.range.getRow() != 1) { | |
sh.getRange(e.range.rowStart, 2).setValue(utcNow) | |
} | |
if (sh.getName() == 'Sheet1' && e.range.getColumn() == 3 && e.range.getRow() != 1) { | |
sh.getRange(e.range.rowStart, 4).setValue(utcNow) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment