January 2, 2018
Hi, I want to get ThingSpeak's server time in order to calculate how much time has past since the last feed update.
for example, https://api.thingspeak.com/channels/300978/feeds/last returns "created_at":"2018-12-07T15:14:07Z", and if I had server's time as well I could calculate the time difference. It would be perfect to receive server time in the same response. I don't want to rely on another time sources. Is it possible?
March 7, 2017
The thingSpeak API does not presently provide the server time.
When I write code to get the time, I usually do an update right before I read and then use the created at time.
Another thing you could do would be to run a MATLAB analysis that writes the time to a channel (same or different channel). Set the analysis to run regularly, using a MATLAB analysis.
Then you an compare the time written and created at for the time entry to the created at for the read you are already doing, and deduce the actual server time. I think the best accuracy you can do with a single read is 1-2s.
You can use datetime('now') to get the present time.
Most Users Ever Online: 166
Currently Browsing this Page:
Guest Posters: 1
Newest Members:adeeeban, theweddingties, Vasant Gosai, pavithra, shivaniprakash, Akeyan
Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457