I'm trying to insert the current time as a static value in Google sheets on a mobile device.
The keyboard shortcut Ctrl + Shift + ; works on the desktop but not the mobile app and "=NOW()"
works to insert the time but as a dynamic value.
Is there a script I can use to cut and paste the dynamic value as a static value?
Insert Timestamp in Google Sheets For static timestamps, you can also use CTRL + ; and CTRL + : to insert the date or time. However, Google Sheets has a keyboard shortcut that Excel doesn't – CTRL + ALT + SHIFT + ; (Control Alt Shift Semicolon). This inserts a static date and time into the selected cell.
Insert Current Time in Google Sheets Using NOW You can use this function by typing =NOW() into the required cell. It's important to note that this function will update the timestamp only when you change the document.
On a mobile app, none of the script-based UI extensions will be visible, but if you're willing to use the full web interface on your device (ouch), you could add a menu or sidebar add-on that inserts the current time into the active cell.
Here's a hack that watches for specific text being added to a cell, then updates the content with the current date. (You can format the cell to display time instead.) Just put #datetime
in any cell, and watch it be replaced. Note though, that this only works for EDITs, not other types of changes. Tested with Sheets app on iOS7.2, and it works.
/**
* onEdit trigger function is called whenever text is edited in
* the spreadsheet.
*
* If the content criteria is met, content will be replaced with
* current time.
*/
function onEdit(e) {
if (e.value.toUpperCase() == '#DATETIME') {
e.range.setValue(new Date());
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With