I have been trying to use the google sheetโs function NOW() as column 1 value.
But unfortunately after trying a lot I have not been able to copy column 1 value to column 2.
I want to accomplish this functionality because column 1 value changes continuously due to google sheetโs NOW() function.
Solved! Go to Solution.
The best you can get is the time the AppSheet server received the new or updated row. The time recorded by the AppSheet server cannot be manipulated by the user and is not subject to the userโs deviceโs time. But, the server-provided time reflects the current server time when the data was received by the server, not the time when the data was actually added or updated by the user on their device. There will always be at least a small delay between the user input and the server timestamp because the userโs change must sync to the server. If the user is offline and doesnโt sync for three days (for example), the server-provided time will be three days after the actual change.
To capture the server time, create a workflow on the table that triggers on adds and/or updates and sets a column in the added or updated row to either NOW()
or UTCNOW()
(depending on your comfort level dealing with time zones).
Hi @Muhammad_Hamadan
Could you please explain further what you are trying to do and why. Maybe you could use App formulas or initial value??
sure @Lynn. thanks for your response.
I donโt want the userโs device time to be recorded. Rather I want the time from google sheet to be recorded at the time of submitting the report.
Appsheetโs time functions return the device time as far as I know.
@Muhammad_Hamadan
Why donโt use UTCNOW()? It returns the current date&time value from the AppSheet server as per UTC. If the NOW() value has an importance to you (as per user) you can get that with concatenating UTCNOW() and USERTZOFFSET() expressions.
thanks a lot @LeventK. I didnโt know UTCNOW() could be used.
I hope it will solve the problem of user changing the device time and then submitting the report.
Iโll try it.
@Muhammad_Hamadan
UTCNOW() value directly generated from the AppSheet server, not from the userโs device, thus it doesnโt affect the returning value provided the user changes the deviceโs date&time or even regional settings.
No it does not, nor has it ever done so.
Nope.
The best you can get is the time the AppSheet server received the new or updated row. The time recorded by the AppSheet server cannot be manipulated by the user and is not subject to the userโs deviceโs time. But, the server-provided time reflects the current server time when the data was received by the server, not the time when the data was actually added or updated by the user on their device. There will always be at least a small delay between the user input and the server timestamp because the userโs change must sync to the server. If the user is offline and doesnโt sync for three days (for example), the server-provided time will be three days after the actual change.
To capture the server time, create a workflow on the table that triggers on adds and/or updates and sets a column in the added or updated row to either NOW()
or UTCNOW()
(depending on your comfort level dealing with time zones).
@Muhammad_Hamadan
You may also take a look at this:
Thanks @LeventK
Youโre welcome
Thanks a lot @Steve It worked.
@Steve Is it possible to add a time duration to the date that I get from the server?
I want to add five hours to the date of the server.
I have tried DATE(NOW()) + โ005:00:00โ but it only returns the date of the server and does not add the time duration.
To the date? Or to the date & time?
NOW()
produces a DateTime value. DATE(...)
converts that DateTime value to a Date value, which removes the time component. Adding 5 hours to a Date value produces a Date value.
Try this instead:
NOW() + "005:00:00"
See also:
@steve I somehow want to add 5 hours to the date of server.
If the serverโs date and time are 19th Jan 2021, 7:00 pm respectively, the date and time in my country would be 20th Jan 2021, 12:00 am.
My country is 5 hours ahead of the serverโs time.
I want to accomplish this using a workflow rule so that the date cannot be manipulated by the user.
Hi! Steve! I am also struck in a similar situation and want to get the Server DateTime, however the workflow as suggested by us is not getting activated in my app. Could you elaborate further.
@Steve , I would like to ask you (if you know this information):
If I have a column with an auto compute formula with the now() function, the time that is recorded is the device time?
If so, and assuming that the device has a delay of 2 hours (for whatever reason), those 2 hours of delay are the ones that are recorded when recording that record in appsheet?
thanks, marcos
Thank you very much for correcting my mis-information @Steve.
@LeventK It isnโt working. I changed my deviceโs date and time to check if the time recorded would not be affected.
@Mleiva550 wrote:If I have a column with an auto compute formula with the now() function, the time that is recorded is the device time?
Correct.
@Mleiva550 wrote:If so, and assuming that the device has a delay of 2 hours (for whatever reason), those 2 hours of delay are the ones that are recorded when recording that record in appsheet?
Correct.
User | Count |
---|---|
39 | |
35 | |
29 | |
23 | |
18 |