Is there a way to get server time | ThingSpeak API | Forum


Please consider registering

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —

— Match —

— Forum Options —

Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Is there a way to get server time
No permission to create posts
December 7, 2018
10:34 am

Forum Posts: 5
Member Since:
January 2, 2018
sp_UserOfflineSmall Offline

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, 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?

December 8, 2018
9:26 pm

Forum Posts: 730
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

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.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

cranioex,, Vadisa, arva, zarin, quicklearner7

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457