offset sometimes being ignored | Mobile Apps | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





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

sp_Feed sp_TopicIcon
offset sometimes being ignored
No permission to create posts
April 17, 2014
6:21 am
Avatar
chrisjmears

Gold
Members
Forum Posts: 54
Member Since:
April 26, 2013
sp_UserOfflineSmall Offline

Ive noticed if I repeated use the same url

https://api.thingspeak.com/channels/5384/feed/last.json?&status=true&offset=1

most of the time it will report the time with the offsett

{"created_at":"2014-04-17T11:17:15+01:00",.....etc

but if you keep doing it, you often get times returned with no offset

{"created_at":"2014-04-17T10:17:15Z",......etc

These are throwing my app as I am relying on having accurate times returned with the offsett.

This seems to be recreatable. Just paste in the url above and fire it off. Arond every 9th or 10th call to it will drop the offset

April 17, 2014
5:49 pm
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi,

We've just implemented a fix for this, can you verify that it's working properly for you now?

lee

April 18, 2014
4:21 am
Avatar
chrisjmears

Gold
Members
Forum Posts: 54
Member Since:
April 26, 2013
sp_UserOfflineSmall Offline

I will test it. Previously utc was showing 1 hour behind GMAT (we are in British summertime now) so I was correcting for that with offset =1. Since your fix the raw utc feed now seems to match gmt. Is this intentional. I.e previously was utc wrong or is it now wrong?

April 18, 2014
10:49 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Yes that fix was intentionally added in too, so that the offset correctly matches the description: "Offset of your timezone without daylight savings time".

lee

April 23, 2014
3:31 am
Avatar
chrisjmears

Gold
Members
Forum Posts: 54
Member Since:
April 26, 2013
sp_UserOfflineSmall Offline

Still a bit of a bug. just grabbing the last.json correctly gives the time as utc. i.e 7.29am however if I add offset=1 I'd expect to get back the utc + 1 hour. i.e 8.29. what I get is 9:29

It seems to be treating an offset of 1 as an offset of 2

Probably just a very minor bug somewhere in the code but a fix would be appreciated?

April 23, 2014
11:16 am
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi,

If the offset is set to +1 (let's call it Berlin time), then daylight savings time is applied during part of the year (including now) to get an offset of +2 for the current time zone offset: http://www.timeanddate.com/worldclock/city.html?n=37

lee

April 23, 2014
1:21 pm
Avatar
chrisjmears

Gold
Members
Forum Posts: 54
Member Since:
April 26, 2013
sp_UserOfflineSmall Offline

Hi lee. I still have the problem. Say it's 8:21am in the uk (British summertime) f I don't specify an offset it gives 7:21am if I apply offset=1 it gives. 9:29am. I can't figure how to get 8:21am

April 23, 2014
7:17 pm
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi Chris,

We are currently working on this problem, as we're now noticing subtle inconsistencies in our implementation of the "offset" parameter as you've pointed out. I'll post back here when we have a final solution.

lee

April 25, 2014
2:57 pm
Avatar
lee

Admin
Forum Posts: 457
Member Since:
March 14, 2011
sp_UserOfflineSmall Offline

Hi Chris,

We've made some changes to the way offset works. Offset no longer has a direct correlation with time zones, and will output the results in whatever offset is specified. For example, an offset of "-5" will always output feeds with a timestamp that includes "-5", regardless of daylight savings time.

We introduced a new parameter called "timezone" that ensures proper time zone transformation; you'll probably want to use this parameter since it's much more accurate and automatically handles any daylight savings time issues.

Here's the changes to the parameters: https://thingspeak.com/docs/channels#get_feed , and here's the relevant time zone documentation: https://thingspeak.com/docs#timezones .

lee

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

swatiiot, kalyanigaware16@gmail.com, Romi, Drakan01, majidkhan7, atharvganla

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457