필터 지우기
필터 지우기

Thingspeak REST API READ results in data from wrong timezone

조회 수: 7 (최근 30일)
Andrew Clark
Andrew Clark 2022년 7월 28일
댓글: Juniarko 2022년 12월 23일
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.
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
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개)

Christopher Stapels
Christopher Stapels 2022년 8월 1일
Check out the timezone and offset parameters in the read data endpoint.

카테고리

Help CenterFile Exchange에서 Read Data from Channel에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by