How to Add a Timestamp in Google Sheets Automatically

How-to basics · Updated November 3, 2026

How to Add a Timestamp in Google Sheets Automatically

To add a fixed timestamp in Google Sheets, select a cell and press Ctrl+Alt+Shift+; on Windows or ChromeOS; on a Mac, press Command+Option+Shift+;. For a timestamp that updates automatically when you edit a row, use a small Apps Script instead. The right method depends on whether you need a permanent record of when something happened or a live date and time that changes as the sheet recalculates.

What You’ll Need

  • A Google account and access to the spreadsheet in a web browser.
  • For automatic timestamps, permission to edit the spreadsheet and open its Apps Script project. Your organization may restrict scripts.
  • A plan for where the timestamp should go, such as a dedicated column beside the data or status it records.

You do not need a special add-on to enter a timestamp manually. If collaborators use different time zones, check the spreadsheet’s time zone before relying on the displayed time.

Step-by-Step

  1. Choose the kind of timestamp you need. A fixed timestamp stays the same after it is entered, which is useful for recording when a task was completed or a row was added. A live timestamp changes when Google Sheets recalculates the sheet. An automatic edit timestamp is written when someone changes a specified cell or row. These behave differently, so decide before choosing a method. For an audit-style record, use a fixed value or a script rather than a live formula.
  2. Set up a clear place for the timestamp. Add a heading such as “Updated at” in a column next to the information being tracked. For example, you could use column A for a task, column B for its status, and column C for the time the status was entered. Keep the timestamp in its own column rather than combining it with a note; that makes it easier to sort, filter, format, and use in later calculations.
  3. Enter a fixed date and time with the keyboard shortcut. Click the cell where the timestamp belongs. In Google Sheets in a browser on Windows or ChromeOS, press Ctrl+Alt+Shift+; (semicolon). On a Mac, press Command+Option+Shift+;. Google Sheets enters the current date and time as a value, rather than a formula that keeps updating. If your keyboard layout makes the semicolon shortcut awkward, use the separate date and time shortcuts: Ctrl+; for the date and Ctrl+Shift+; for the time on Windows or ChromeOS; use Command+; and Command+Shift+; on a Mac. You can put those entries in separate cells, or use the combined shortcut for one cell.
  4. Check the timestamp’s display format. If the value appears as a serial number, select the cell and choose Format > Number > Date time. You can also use Format > Number > Custom date and time to choose a display such as a four-digit year and seconds. Formatting changes how the value looks, not the underlying timestamp. For instance, hiding seconds does not remove them from the stored value; it only changes what is shown in the cell.
  5. Use a formula when a live timestamp is appropriate. If cell D2 is intended to show the current date and time and update as the spreadsheet recalculates, enter =NOW() in D2. The result includes the current date and time, and you can format it with Format > Number > Date time. This is useful for a dashboard that should show the current time, but it is not a reliable way to record when a particular row was first entered: the result can change later. Do not use it for an unchanging event log unless you convert its result to a value or use another method.
  6. Turn a live result into a fixed value if needed. If you already used NOW() and want to keep the displayed moment, copy the formula cell, then choose Edit > Paste special > Values only. The pasted result is a value rather than a live formula. Check that the pasted cell still displays both date and time; if necessary, apply Format > Number > Date time. This is handy for a one-off conversion, but repeating it for many rows can be cumbersome.
  7. Automate a timestamp when a cell is edited. For a recurring workflow, use a bound Apps Script. In the spreadsheet, choose Extensions > Apps Script. Remove any sample function in the editor and paste the code below. This example watches column B, starting on row 2, and writes a timestamp into column C the first time a nonempty value is entered in B. It leaves an existing timestamp alone, so later edits to the status do not silently overwrite the original time.
function onEdit(e) {
  const range = e.range;
  const sheet = range.getSheet();
  const row = range.getRow();
  const column = range.getColumn();

  // Watch single-cell edits in column B, below the header.
  if (row < 2 || column !== 2) return;
  if (range.getNumRows() !== 1 || range.getNumColumns() !== 1) return;
  if (e.value === undefined || e.value === "") return;

  const timestampCell = sheet.getRange(row, 3);
  if (timestampCell.isBlank()) {
    timestampCell.setValue(new Date());
    timestampCell.setNumberFormat("yyyy-mm-dd hh:mm:ss");
  }
}
  1. Save and try the script on a test row. Click Save in the Apps Script editor, return to the sheet, and enter a value in B2. The script should put the date and time in C2. A simple onEdit(e) trigger runs when a person edits the sheet; you normally do not need to run it from the Apps Script editor or create a separate trigger for this example. If you want the timestamp to change on every edit to column B, remove the if (timestampCell.isBlank()) check and its braces. Test that change on a copy first, because it replaces the original time.
  2. Adjust the example to match your sheet. The code uses column numbers: 2 means B and 3 means C. To watch column D and write to E, change the comparison from 2 to 4 and the destination from 3 to 5. The example applies to whichever sheet is edited in the spreadsheet. If only one tab should be watched, add a sheet-name check before writing the timestamp. It deliberately ignores multi-cell pastes; a paste can affect many rows at once, and should be handled with a script designed for that case if you need it.

Google Sheets runs in the browser, so its shortcuts can differ from Excel’s. In Excel for Windows, Ctrl+; enters the date and Ctrl+Shift+; enters the time; Excel’s shortcuts and menus are not a substitute for the Google Sheets steps above. If a shortcut is captured by your operating system or browser, use a Google Sheets formula or script instead.

Common Mistakes

  • Using NOW() for a permanent record. NOW() is a live function and can recalculate. A cell that seemed to record an event time may show a later time after the spreadsheet recalculates. Use a keyboard shortcut, paste the formula result as a value, or use an edit-triggered script for a fixed record.
  • Confusing a date with a timestamp. The date shortcut enters a date without the current time. The time shortcut enters a time without the date. Use the combined date-and-time shortcut when both parts belong in one cell.
  • Overwriting an existing timestamp by accident. A script that always writes a new time on every edit records the latest change, not the first entry. Decide whether you want “created at” or “last updated” and configure the script accordingly.
  • Expecting a script to timestamp every kind of change. A simple onEdit trigger responds to edits made by a person in the spreadsheet. It does not run just because a formula recalculates, and edits made by another script or API do not trigger it in the same way. The example also skips multi-cell pastes.
  • Assuming the displayed time is the wrong stored value. A cell can show only a date, only a time, or a number because of its number format. Set the format to Date time before concluding that the timestamp itself is missing.

Tips

  • Use a heading that explains what the time means: “Created at,” “Completed at,” and “Last updated” describe different events.
  • Use one consistent date-time format throughout the column. A format such as yyyy-mm-dd hh:mm:ss is unambiguous for readers familiar with that convention and includes seconds when you need to distinguish entries made close together.
  • Set the spreadsheet’s time zone by choosing File > Settings and checking the General section. Apps Script’s new Date() uses the script’s time context, and the spreadsheet displays date values using its settings; check the project and spreadsheet settings if collaborators report a mismatch.
  • Keep timestamps as actual date-time values rather than typing them as text. Real date-time values can be sorted chronologically and used in calculations. If an imported timestamp is left-aligned or will not sort as expected, it may have been imported as text.
  • Protect the timestamp column if collaborators should not manually edit recorded times. Select the relevant cells and choose Data > Protect sheets and ranges, then set the permissions that fit your workflow.
  • Try script changes on a duplicate or a few disposable rows first. Once a script has replaced an existing timestamp, undo may not restore the intended history, so keep a backup if the data matters.

Troubleshooting

The shortcut does nothing: Confirm that the spreadsheet has focus and that a cell is selected, then try the shortcut for your operating system. On some keyboards, you may need the key that produces a semicolon rather than a key labelled differently. Browser or system shortcuts can also intercept combinations. As a workaround, enter the date and time in separate cells with their shortcuts, use NOW() for a live display, or use the script method for automatic entry.

The timestamp appears as a number or only part of it is visible: Select the cell and apply Format > Number > Date time. If the column is too narrow, widen it by dragging the boundary between its column letters. A custom format can hide seconds or the date, so inspect the format if the value looks incomplete.

The script does not run: Make sure it was saved in the spreadsheet’s Apps Script project, return to the correct spreadsheet, and make a direct edit in a single cell in column B below the header. A formula changing in B, a multi-cell paste, or an edit in another column will not meet the example’s conditions. Check that the timestamp cell in column C is blank; the sample intentionally will not replace it. If your organization blocks Apps Script, ask the administrator about permitted options.

The recorded time differs from a collaborator’s clock: Check File > Settings > General > Time zone in the spreadsheet. Confirm the Apps Script project’s time zone in its project settings as well. Use a shared, agreed time zone for the sheet rather than relying on each person’s computer clock display.

The time changes after entry: If the cell contains a formula, select it and look at the formula bar. Replace a live NOW() result with a fixed shortcut entry, or copy it and use Edit > Paste special > Values only. A script configured to overwrite timestamps will also change the time when its watched cell is edited; retain the blank-cell check if you want the first-entry time preserved.

Frequently Asked Questions

Does Google Sheets have a built-in static timestamp shortcut?
Yes. In a browser on Windows or ChromeOS, Ctrl+Alt+Shift+; enters the current date and time in the selected cell. On a Mac, use Command+Option+Shift+;. The date and time shortcuts can also be entered separately.

Will =NOW() stay fixed after I enter it?
No. NOW() is a live function and can update when the sheet recalculates. Use a shortcut or convert the formula result to a value if the time must stay fixed.

Can I timestamp a row automatically when I fill in a status?
Yes. Use an Apps Script onEdit trigger to watch the status column and write the time to a neighboring cell. Specify whether it should record the first entry only or replace the time on every later edit.

Can the timestamp include seconds?
Yes. Apply Format > Number > Custom date and time and choose a format that includes seconds, or use a custom format such as yyyy-mm-dd hh:mm:ss. Seconds may be stored even when the cell’s current display hides them.

Can I make a timestamp update only when a particular column changes?
Yes. The sample script checks the edited column number, so it ignores changes in other columns. Change the watched and destination column numbers to suit your layout, and test the script with sample data before using it on important records.

Do timestamps use my computer’s time zone?
The spreadsheet’s time zone affects how date-time values are displayed, and script settings can matter for script-generated dates. Check both settings and agree on a time zone with collaborators when consistent records are important.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.