Hello What time is GOOGLECLOCK() in Spreadsheets?
I know, from the documentation, that GoogleClock “Returns the current date and time according to your computer system” (quote).
But what about when the spreadsheet is opened client side by a time-driven trigger? What time will GoogleClock() be?
If anyone has any ideas, please kindly share.
Many thanks for looking.
Quick and easy to test. This will illustrate that the documentation is confusing, and likely wrong. (But it’s on the Internet, so it must be true!)
Set the formula in cell A1 to
GoogleClock().Enter test script. This just reads the value in A1, and writes it to A2.
Set a time based trigger to fire once, at a known time.
Close your spreadsheet, leaving only the trigger to use it.
Go back to your spreadsheet after the trigger has run, and check the results.
After it fires, you’ll see that A2 = A1, at least until A1 changes as it does each minute. I think that the documentation might mean that the time will be displayed according to the timezone and locale of your computer; but it isn’t reading the time from your computer. So the actual source of the clock is the same as it is for the
Today()function; the server it’s executing on.As a further experiment, change the time on your PC; make it 10 minutes off, say. Look at your spreadsheet, and watch for
GoogleClock()to tick. It keeps network time, regardless of what your PC is set to.Next, change your PC’s time zone. Check
GoogleClock(). You’ll find it doesn’t match the time zone change… still keeps network time, regardless of what your PC is set to.What about the spreadsheet settings? Change those to be in a different time zone, and you’ll find that
GoogleClock()matches it.The docs should say..
Or, to be consistent with the documentation for
Now()…PS: fix your time settings after these experiments!