40

I've got a spreadsheet in Google Drive and one column is meant for the date the entry is made. Is there a button to do this? I'm aware of the functions =NOW() and =TODAY() but their description says "the value is updated when the document recalculates". However I reopened the document a few minutes latter and it still had the same time. Why is this?

It would be even easier that when I start typing in a new row the column for the date auto-populates.

Rubén - Volunteer Moderator -
  • 46,305
  • 18
  • 101
  • 297
Celeritas
  • 3,558
  • 23
  • 47
  • 68

10 Answers10

56
  • ctrl+; inserts current date
  • ctrl+shift+; (ctrl+:) inserts current time
  • ctrl+alt+shift+; (ctrl+alt+:) inserts current date and time

Use instead of ctrl on Mac OS

However it does not work in Google Sheets mobile app. Seems that mobile app has no similar functionality. =now() updates to current date and time when any edit is made to spreadsheet so it's not suitable for registering times. It does not even have "Paste values only".

kolen
  • 661
  • 1
  • 5
  • 3
21

I was able to reproduce your findings, however, opening a spreadsheet doesn't result in a re-calculation.

Press Ctrl + R to recalculate the entire sheet.

There's one concern about this method: it changes all NOW() formula's into the current date/time.
Therefore you might want to consider pressing Ctrl + ; in the creation date cell and add the date manually.

Reference: Recalculation of Sheet

Jacob Jan
  • 23,322
  • 16
  • 106
  • 195
8

I think the question is how to get today's date into a spreadsheet cell so that remains unchanged over time.

I put "=today()" into a frozen header cell one time. That changes as the date changes.

When I need today's date, I copy that cell and Paste special>Paste value only into the desired cell.

Steven Zins
  • 81
  • 1
  • 1
6

To insert static DateTime value use macros:

In your sheet Tools -> Script Editor. Paste this code:

function currentStaticDate() {
  var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getCurrentCell().setValue(new Date());
};

Save and return to your sheet.

Import script with Tools -> Macros -> Import.

Add shortcut with Tools -> Macros -> Manage macros.

jonsca
  • 1,732
  • 18
  • 23
  • 44
RasAlhague
  • 61
  • 1
  • 1
3

Notice: this answer does not work anymore as GoogleClock() has been replaced by the NOW() function.

Another option to consider is =GoogleClock(). This function differs somewhat from =NOW() in that it has a granularity of one minute (rather than one second), but it is guaranteed to update each and every minute, and be correct (to the nearest whole minute) on opening/refreshing the spreadsheet.

If you use:

=NOW()+GoogleClock()*0

you will have a granularity of one second, it will update with every edit, and be no less than one minute off when you open the spreadsheet. But it will also update every minute regardless of editing, which may not be desirable.

marikamitsos
  • 13,110
  • 4
  • 35
  • 59
AdamL
  • 2,299
  • 17
  • 12
2

On a Brazilian portuguese keyboard use

  • Ctrl+ç for current date
  • Ctrl+Shift+ç for current time
  • Ctrl+Alt+Shift+ç for current date and time
2

On an italian keboard use

  • Ctrl+è for current date
  • Ctrl+Shift+è for current time
  • Ctrl+Alt+Shift+è for current date and time
Gabriele
  • 21
  • 1
1

Further to @RasAlhague's excellent answer, I added a Menu to insert the date, by adding in this function:

function onOpen(){
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = []
menuEntries.push({name: "Insert current static date", functionName: "currentStaticDate"})
spreadsheet.addMenu("Insert current static date", menuEntries);
grokster
  • 924
  • 7
  • 12
1

On a German keyboard use

  • Ctrl+ö for current date
  • Ctrl+Shift+ö for current time
  • Ctrl+Alt+Shift+ö for current date and time
serenesat
  • 10,042
  • 30
  • 34
  • 50
ocin4
  • 11
  • 1
-1

On a Swedish Mac keyboard use + D.

Glorfindel
  • 2,379
  • 5
  • 19
  • 28