To add a fixed timestamp in Google Sheets, select a cell and press Ctrl+; to insert the date, type a space, then press Ctrl+Shift+; to insert the time. On a Mac, use Command+; for the date and Command+Shift+; for the time. For a live timestamp that updates, enter =NOW() instead. You can also use a small Apps Script to stamp a row automatically when you edit it.
A fixed timestamp stays as entered, which is useful for recording when an order arrived or a task was completed. A formula timestamp recalculates, so it is better for displaying the current date and time than keeping an audit trail. The steps below explain both options and an automated approach.
What You’ll Need
- A Google account and a spreadsheet open in Google Sheets in a web browser.
- For keyboard shortcuts, a keyboard that has Ctrl or Command and semicolon keys. If the shortcut is inconvenient on your device, you can use the formula method.
- For automatic row timestamps, permission to open the spreadsheet’s Apps Script editor and edit its script.
Step-by-Step
- Choose what kind of timestamp you need. Use a keyboard shortcut when you need a fixed date and time that will not change later. Use
=NOW()when you want a cell to show the current date and time and update as the sheet recalculates. Use Apps Script when you want a fixed timestamp to be written automatically after someone edits a row. Decide this first: the methods behave differently, even if their cells initially look alike. - Insert a fixed date and time with keyboard shortcuts. Click the cell where the timestamp should go. On Windows or ChromeOS, press Ctrl+; to insert the date. Press Space, then Ctrl+Shift+; to append the time in the same cell. On a Mac, use Command+; for the date, then Space and Command+Shift+; for the time. The result is a fixed value, not a formula, so it does not change tomorrow. If you only need the date or only the time, use just the corresponding shortcut. Check the cell after entering it; if your keyboard layout or browser handles the shortcut differently, use the formula method below and paste a value if you need it fixed.
- Set a readable date-and-time format if needed. Select the cell or range, then choose Format > Number and select a date-time option if one is suitable. To choose a specific display, use Format > Number > Custom date and time. Pick a display that includes both a date and a time, such as a year-month-day date followed by hours and minutes, and click Apply. Formatting changes how a value appears, not the underlying timestamp. If you see only a date, the time may still be stored but hidden by the current format.
- Use NOW() for a live timestamp. Click the cell where the changing current date and time should appear. With the cell location unspecified, enter this formula in that cell:
=NOW(). Press Enter. Google Sheets displays the current date and time, subject to the cell’s number format. If necessary, set a date-and-time format using Format > Number. NOW() is volatile: its result can update when the spreadsheet recalculates, so it is not a dependable record of when a particular row was first entered. Do not use it as a fixed submission time unless you convert the result to a value or use the automation method. - Understand recalculation before relying on NOW(). Google Sheets recalculates NOW() as the sheet changes and according to its recalculation settings; it does not simply freeze the time when you first type the formula. To check the setting, open File > Settings and review the Calculation tab. Changing recalculation frequency affects when the live result refreshes, not whether it becomes fixed. If you need a snapshot, copy the cell and use Edit > Paste special > Values only in the destination cell. The pasted result is a value rather than a live NOW() formula.
- Set up an automatic timestamp for edited rows (optional). This example assumes column A contains the item or task and column B is where the timestamp should go. In the spreadsheet, choose Extensions > Apps Script. The script editor opens in a new tab. Replace the starter code in the editor with the code below, then click Save project. The script writes the current time into column B when a non-header cell in column A is edited. If the column A entry is cleared, it clears that row’s timestamp too.
function onEdit(e) {
// Watch column A and write timestamps in column B.
const range = e.range;
const sheet = range.getSheet();
const firstColumn = range.getColumn();
const lastColumn = range.getLastColumn();
if (firstColumn > 1 || lastColumn < 1) return;
const firstRow = range.getRow();
const lastRow = range.getLastRow();
for (let row = firstRow; row <= lastRow; row++) {
if (row === 1) continue; // Keep the header row unchanged.
const entry = sheet.getRange(row, 1).getValue();
const timestampCell = sheet.getRange(row, 2);
if (entry !== '') {
timestampCell.setValue(new Date());
} else {
timestampCell.clearContent();
}
}
}
- Test the script on a data row. Return to the sheet and enter a sample value in A2. A timestamp should appear in B2. Edit A2 again and the timestamp will update to the latest edit time. Clear A2 and the script clears B2. The code skips row 1 as a header and also handles a pasted range that includes column A. Change the column numbers in the script if your entry and timestamp columns are elsewhere: 1 means A, 2 means B, and so on. Format the timestamp column with Format > Number > Custom date and time if you want a particular display.
- Keep the script attached to the right spreadsheet. A simple onEdit trigger runs when a person edits the spreadsheet; you do not need to click Run in the script editor. Do not run onEdit manually there, because a manual run does not provide the edit event the function expects. The script only handles edits made in the watched sheet itself, and it does not run when a formula recalculates or when another script changes a cell. If Google asks for permission after you adapt the script to use additional services, review the request before authorizing it.
Common Mistakes
- Expecting NOW() to stay fixed. NOW() displays the current date and time and may refresh. For a permanent record, use the keyboard shortcut, paste a formula result as a value, or use the script.
- Confusing display format with the stored value. A cell formatted to show only a date can hide the time portion. Change the number format before deciding the timestamp is missing.
- Putting the script in the wrong columns. The example watches column A and writes to B. If your sheet uses different columns, update both column references rather than just changing the output format.
- Typing a timestamp as ordinary text. A value that looks like a date may be stored as text, which can sort or calculate unexpectedly. Prefer the shortcut or a recognized date-time value, then check that the cell is treated as a date or time.
- Assuming automatic means every kind of change. The simple onEdit trigger responds to user edits, not every formula result, import, or script-driven change. Use a suitable different automation design if your workflow depends on those events.
Tips
- Put timestamps in a dedicated column and label it clearly, for example “Last edited.” Freeze or protect that column if users should not overwrite the records manually.
- Use a format that includes the year and minutes when the records may be reviewed later. Add seconds if several entries could occur within the same minute. The displayed format does not change the timestamp’s underlying precision.
- Remember that timestamps use the spreadsheet’s time zone. Check File > Settings if the displayed time does not match the time zone your team expects. Formatting and time-zone settings affect display; they do not change the shortcut-versus-live-formula distinction.
- For a timestamp that records the first time a row is completed and never updates afterward, adjust the script so it writes only when the timestamp cell is empty. The example above deliberately records the most recent edit instead.
- Google Sheets uses Apps Script for this type of automation. Excel has different automation tools and shortcut behavior, so do not assume a Google Sheets script or menu path will work there.
Troubleshooting
The shortcut inserts nothing or triggers another browser action: Confirm you are editing a cell in Google Sheets, try the shortcut for your operating system, and check your keyboard layout. Some browser or device combinations intercept key combinations. You can enter =NOW() for a live value instead, or use the menus to set a date-time display. If you need a fixed value and the shortcut is unavailable, enter a date and time as a recognized value and verify the cell format.
The cell shows a number or only part of the timestamp: Select it and choose Format > Number, then select a date-time format or set one through Custom date and time. If it shows a large decimal number, Sheets may be displaying the underlying date-time serial value in a number format; applying a date-time format should make it readable.
The automatic timestamp does not appear: Make sure you saved the script, entered a value in column A below the header, and are editing the same spreadsheet the script is attached to. Check that the entry and timestamp columns match the code. A formula changing in column A will not trigger this simple edit function. If the editor reports an error, reopen Extensions > Apps Script and check the execution details for the cause.
The time is wrong: Review File > Settings and check the spreadsheet time zone. Also check whether the cell is showing a different format or whether you are comparing local time with a different time zone. If a fixed timestamp was already entered, changing the display format cannot change when it was originally recorded.
Frequently Asked Questions
Does a Google Sheets timestamp update automatically?
A shortcut timestamp is fixed. A NOW() formula can update when the spreadsheet recalculates. An Apps Script timestamp is a fixed value when written, although the example updates it again whenever the watched entry is edited.
How do I insert only the current date?
Select the cell and press Ctrl+; on Windows or ChromeOS, or Command+; on a Mac. This inserts a fixed date. Format the cell as a date if its display is not what you expect.
Can I make a timestamp appear when someone fills in a row?
Yes. The Apps Script example watches column A and writes a timestamp in column B. You can change the watched and output column numbers to fit your layout. The example records the latest edit, not the first entry.
Can I stop the timestamp from changing after the first entry?
Yes. Change the script’s write condition so it sets a timestamp only if the timestamp cell is blank. That preserves the original time; decide separately whether clearing the source entry should also clear the timestamp.
Why does NOW() show a date but no time?
The cell may be formatted to display only a date. Select it and choose Format > Number > Custom date and time, then choose a format that includes hours and minutes.
Will a timestamp record who edited the row?
No. The shortcut and the example script record a date and time, not an editor’s identity. Recording editors requires a different approach and may depend on account permissions and privacy requirements.
Related
- How to Clear Cache in Outlook 365 on Windows, Mac, and Web
- How to Clear Cache in MS Outlook Without Losing Mail
- Clear Cache in Microsoft Outlook: Windows, Mac & Mobile
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Google Sheets GOOGLEFINANCE: Prices, History, and LimitsGoogle Sheets’ GOOGLEFINANCE function retrieves supported market information, including current quote data and historical prices, directly into a…
- Freeze Multiple Rows in Excel: Step-by-Step GuideTo freeze multiple rows in Excel, select the cell in column A directly below the last row you…
- How to Remove Data Validation Rules in Google SheetsTo remove data validation in Google Sheets, select the affected cells, open Data > Data validation, then remove…
- Export Outlook Contacts to vCard: Steps and OptionsYes. In classic Outlook for Windows, you can save an individual contact as a vCard (.vcf); Outlook does…
- PowerPoint Template: How to Create Your Own DesignTo create your own PowerPoint template in Microsoft 365 for Windows, open a presentation, choose View > Slide…
- Present in PowerPoint With Notes on Screen: How ToYes. In Microsoft PowerPoint for Microsoft 365 on Windows, turn on Presenter View and use an extended display:…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.