ThingSpeak data has wrong Time Zone
이전 댓글 표시
My pofile has the Time Zone set to US Mountain (GMT-07:00), but the data is being displayed with US Pacific time (GMT-08:00). I am not encoding any explict time or zone information with my data.
How do I get the data to display in Mountain Time?
댓글 수: 8
Christopher Stapels
2022년 9월 9일
What is the time zone setting on the computer you are using?
Bernard FluscheJr
2022년 9월 11일
Christopher Stapels
2022년 9월 13일
The ThingSpeak plots use your computer setting.
You can use a custom MATLAB visualization and the code provided by Seth below to create a chart with a display in your desired time zone.
There is a time zone parameter in the Charts API, but I feel it is still subordinate to the computer time zone, so that might not help.
Andrew Clark
2023년 8월 18일
Hi Christopher, I have a similar issue with timezone. My profile and computer are both Pacific (GMT-800), and my data sent to Thingspeak via the Arduino API sets the "CreatedAt" field to the same - GMT-800)
...
timestamp += "-0800"; // add UTC adjustment for Pacific TZ
...
ThingSpeak.setCreatedAt(timestamp);
...
But the CreatedAt timestamp I see in both Export Recent Data and data Export both show GMT-700, off by 1 hour. Any ideas? Thanks!
2023-08-17 21:16:55 -0700,233,0,0,0,68.47372,73.41690,37.87529,-122.54132,476
2023-08-17 21:17:36 -0700,234,0,0,0,68.42805,73.46725,37.87536,-122.54131,469
2023-08-17 21:18:15 -0700,235,0,0,0,68.48093,73.32153,37.87531,-122.54137,475
2023-08-17 21:18:55 -0700,236,0,0,0,68.45529,73.45022,37.87535,-122.54139,480
2023-08-17 21:19:35 -0700,237,0,0,0,68.37759,73.60687,37.87540,-122.54137,469
2023-08-17 21:20:15 -0700,238,0,0,0,68.34154,73.55652,37.87535,-122.54137,481
Vinod
2023년 8월 18일
Go here and set your timezone to match your setting:
Christopher Stapels
2023년 8월 18일
@Andrew Clark How are you setting the timezone for your arduino? Is there a chance its creating timestamp with an hour offset already or somewhere else in your code?
Timezone and date stuff is usually rough to track down. Can you try updating using the API from a web browser and see if you see the same result?
Andrew Clark
2023년 8월 18일
Hi, yes, I thought of that. As you can see in the code I supplied in my query, I set the timezone explicitly to "-800" per the Thinkspeak protocol when I set the "Created_At" field (I am using an RTC to get more accurate timestamps on the data.)
timestamp += "-0800"; // add UTC adjustment for Pacific TZ
...
ThingSpeak.setCreatedAt(timestamp);
Is there a conflict between setting CreatedAt and the Thingspeak Profile? Should I stop setting the timezone in my CreatedAt field in the above Arduino code?
Another clue that might help: just now I set the Profile timezone to "-900 (Alaska)" and the timestamps all changed to the correct timezone - "-800"! So something is causing the time to be off by one hour.
Christopher Stapels
2023년 9월 28일
ThingSpeak plots in your browser window will generally take the timezone set for your computer.
답변 (2개)
Vinod
2023년 8월 18일
이동: Christopher Stapels
2023년 8월 18일
1 개 추천
Go here and set your timezone to match your setting:
댓글 수: 1
Andrew Clark
2023년 8월 18일
Hi Vinod, my Profile looks to be set properly to Pacific:

so, looking for something else...thanks!
dt = datetime(2022,1,1,12,0,0,"TimeZone","Etc/GMT-8")
dt.TimeZone = "Etc/GMT-7"
커뮤니티
더 많은 답변 보기: ThingSpeak 커뮤니티
카테고리
도움말 센터 및 File Exchange에서 ThingSpeak에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!