简体   繁体   中英

what's the way to get Timestamp in Google App maker?

I have a form. User fill up the form. which saves the data and send email. The datasource is in manual save mode. I was trying to save timestamp when the user use the form & send email. Then sort the data using the Timestamp field. I have a number field called Timestamp.(Tried using date field too) I'm saving the data as

OnBeforeSave :: record.Timestamp = Date.now();

But It's not saving the time. I'm not getting any error, but when I try to see it in table of data. The field is empty. what am I doing wrong??
Let me know If you need anything else.

Realization:: whenever the datasource is in manual save mode you have to call

datasource.saveChanges();

every time you want to save something. I have added

app.datasources.DataSourceName.item.DateValue = Date.now().toString();
app.datasources.DataSourceName.saveChanges(); 

in my client script. Solved the problem. NB - I have added toString() because I wanted to save my TimeStamp value as a string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM