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 comentarios

Christopher Stapels
Christopher Stapels el 9 de Sept. de 2022
What is the time zone setting on the computer you are using?
Bernard FluscheJr
Bernard FluscheJr el 11 de Sept. de 2022
Pacific
Christopher Stapels
Christopher Stapels el 13 de Sept. de 2022
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.
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
Vinod el 18 de Ag. de 2023

Go here and set your timezone to match your setting:

https://thingspeak.com/account/profile

Christopher Stapels
Christopher Stapels el 18 de Ag. de 2023
@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?
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
Christopher Stapels el 28 de Sept. de 2023
ThingSpeak plots in your browser window will generally take the timezone set for your computer.

Iniciar sesión para comentar.

Respuestas (2)

Vinod
Vinod el 18 de Ag. de 2023
Movida: Christopher Stapels el 18 de Ag. de 2023

1 voto

Go here and set your timezone to match your setting:

https://thingspeak.com/account/profile

1 comentario

Andrew Clark
Andrew Clark el 18 de Ag. de 2023
Hi Vinod, my Profile looks to be set properly to Pacific:
so, looking for something else...thanks!

Iniciar sesión para comentar.

Seth Furman
Seth Furman el 13 de Sept. de 2022
dt = datetime(2022,1,1,12,0,0,"TimeZone","Etc/GMT-8")
dt = datetime
01-Jan-2022 12:00:00
dt.TimeZone = "Etc/GMT-7"
dt = datetime
01-Jan-2022 11:00:00

Comunidades de usuarios

Más respuestas en  ThingSpeak Community

Categorías

Más información sobre ThingSpeak en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 9 de Sept. de 2022

Comentada:

el 28 de Sept. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by