How do I push the current data and time into a date field in my database when I save a record? i.e. I what to save a started_at time in addition to the created_at time to indicate an event has started.
Thank you.
How do I push the current data and time into a date field in my database when I save a record? i.e. I what to save a started_at time in addition to the created_at time to indicate an event has started.
Thank you.
Hello Lee,
Please look at this post:
https://getsatisfaction.com/apperyio/...
It didn't work for me. Not sure if I am putting it in the wrong place? It is in the JS on the field in the request mapping component.
Nevermind, I got it to work. I need to change the timezone on my database. how do I do that?
Thank you!!!
Lee,
Unfortunately this cannot be done, all dates are written with UTC, if it is necessary, you can transfer them in the application
is there an easy formula to do that? I am not a programmer.
Thank you!
Well, assuming I understand you correctly, you just need this method
var UTCstring = (new Date()).toUTCString();
But do remember that the date values you get are based on the clock of the client's machine, not your server
And how would you use that?
You can add a new col / field in your table called _insertedAt or something...and then in your mapping when you call the REST API / or within your Before Send - add the following in the "JS" for that column
var UTCstring = (new Date()).toUTCString();
return (UTCstring);
This will supply the client side time (in UTC, of course) to the REST Call and that way you can have the record insertion time
Thank you. I will test. I appreciate the support.