Thingspeak REST API READ results in data from wrong timezone
7 次查看(过去 30 天)
显示 更早的评论
Hello, I am having trouble with READing Thingspeak data through the REST API, specifically a getJSON request like:
var timez = '&timezone=America/Los_Angeles';
$.getJSON("https://api.thingspeak.com/channels/" + markers[iSensor][iChan] + tsFeeds2 + timez + markers[iSensor][iKey] + tsAvg, function(result) { ...
The result of the READ is good data but in the wrong timezone...seems to be +7 hours instead of correct local time. And yes, I have edited my Thingspeak profile to be "Los Angeles". The data in the Channel Stats and Export Recent Data are all correctly shown in local time format, so Profile must be OK.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1080845/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1080850/image.png)
To summarize, the timestamp of data received through the API is consistently wrong, UTC I am guessing. What do I need to change to receive API data in the proper local timezone like this?
1 个评论
Juniarko
2022-12-23
Hi Andrew,
This is the example from my timezone
https://api.thingspeak.com/channels/your channel ID/feeds.csv?timezone=Asia%2FJakarta
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read Data from Channel 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!