Need a quick time stamp button in Google Sheets? You can set it up in minutes using Apps Script, then record the current date/time in one click.
Quick setup (one-click time stamp)
Fastest setup
- Open Extensions → Apps Script.
- Paste the function below and save.
- Insert a Drawing/Image in your sheet.
- Right click it → Assign script → enter
recordTime. - Select a cell, click the button, and your timestamp is inserted.
function recordTime() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var cell = sheet.getActiveCell();
cell.setValue(new Date());
} First run may show an authorization prompt. Approve it once, then the button works normally.
Write time to a fixed column (same row)
If you want the timestamp always in one column (for example column B), use this variant.
function recordTime() {
var sh = SpreadsheetApp.getActiveSheet();
var r = sh.getActiveCell().getRow();
sh.getRange(r, 2).setValue(new Date()); // column B
} Troubleshooting
If the button is not working
- Nothing happens: check script name is exactly
recordTime. - Permission error: run once from Apps Script editor and authorize.
- Wrong format: set cell format via Format → Number → Date time (or Time).
Related guides
Frequently Asked Questions
How do I record only time (not date) in Google Sheets?
Keep the same script, then format the target cells as Time using Format → Number → Time.
Can this work on shared sheets?
Yes. Editors can use the button. Each editor may need to authorize script access the first time.
Can I use one button for many rows?
Yes. Select the target cell first, then click the button. It writes to the currently selected cell (or fixed column variant if you use that script).