UTC timestamp offset? | ThingSpeak API | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
UTC timestamp offset?
Avatar
willnue

Silver
Forum Posts: 7
sp_UserOfflineSmall Offline
1
April 3, 2011 - 11:15 pm
sp_Permalink sp_Print

This is related to the animated chart post, but concerns the time returned by the ThingSpeak API.

Animated chart post:

http://community.thingspeak.com/forum/thingspeak-api/animated-chart/

 

When looking at the JSON/XML returned from the thingspeak API for a data point logged at 03:28 UTC the timestamp appears as follows:

"2011-04-04T04:28:59+01:00"

The time appears to be off by +1 hour from UTC. Now I do see the following offset of "+1:00" after the time, but it appears the javascript that generates the charts ignores the +1:00 offset resulting in charts that are +1 hour off after applying the results of getTimezoneOffset() to offset the time to your local timezone.

I am curious as to why do the records being returned by the API have an offset to begin with, why not just return UTC?

 

willnue

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
2
April 4, 2011 - 1:04 am
sp_Permalink sp_Print

Thanks for finding this, we were setting our offset based on British time (which has daylight savings time) instead of Zulu time.  Everything should be fixed now.

Avatar
willnue

Silver
Forum Posts: 7
sp_UserOfflineSmall Offline
3
April 4, 2011 - 9:28 am
sp_Permalink sp_Print

OK, so now the chart on the ThingSpeak home page generates correctly, but the charts on the "charts" pages do not:

Looks like different queries are returning different date formats?:

 

Home page chart query:

https://api.thingspeak.com/channels/9/field/1.xml?callback=?&results=15

Date in results of query:

"2011-04-04T14:24:07Z"

 

Chart page - ioBridge Example chart query:

https://api.thingspeak.com/channels/3/field/1.xml?callback=?&offset=0

Date in results of query:

"2011-04-04T15:21:07+01:00"

 

willnue

Avatar
lee

Forum Posts: 457
sp_UserOfflineSmall Offline
4
April 4, 2011 - 3:46 pm
sp_Permalink sp_Print

Again, thanks for finding this, it should be fixed now on the other charts too.

Avatar
willnue

Silver
Forum Posts: 7
sp_UserOfflineSmall Offline
5
April 4, 2011 - 4:29 pm
sp_Permalink sp_Print

It's working now!

Thanks.

willnue

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: cstapels
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

yeseniara11

RomanFug

JamesPes

RobertBak

ScottSmiva

Amourhotte

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee