1

I would like some clarification on tzs for the Jawbone Moves endpoint: https://jawbone.com/up/developer/endpoints/moves. Is this key going to be present on all response items? If not, what types of records will have it vs those that don't. Additionally, the docs indicate it will be an array of arrays with the following format:

"tzs": [
            [1384963500, "America/Phoenix"],
            [1385055720, "America/Los_Angeles"]
        ]

However, I am getting response that look like the following:

"tzs": [[1468410383, -14400]]

Is the second an offset I presume in seconds?

Vance Faulkner
  • 190
  • 2
  • 8

1 Answers1

1

The tzs key will appear in responses from the moves endpoint that provide data for a given day's move. It will always be present, but it will only contain more than one entry if the user changes timezones during the given time period (e.g., the user is travelling).

Here's the explanation from the documentation: tzs description from https://jawbone.com/up/developer/endpoints/moves

Each entry in the list contains a unix timestamp and a timezone. In most instances the timezone entry is a string containing the Olson timezone.

When the timezone entry is just a number, then you are correct it's the GMT offset in seconds, so -14400 corresponds to US/Eastern

RAY
  • 474
  • 4
  • 21
  • Thanks, Ray! Any pattern for when the timezone will be a Olson timezone string vs a GMT offset integer? I'm guessing the expectation is to implement so as to handle either scenarios. – Vance Faulkner Nov 01 '16 at 07:36
  • You're welcome @VanceFaulkner. I'll ask internally when it would occur, but yes, you should build logic based on whether you get a string or an int back. – RAY Nov 01 '16 at 15:56
  • we are getting records that are formatted the following way: [[1478243100, "GMT+0200"]]. The second item does not appear to be an Olson timezone nor an offset in seconds. Can you clarify? – Vance Faulkner Nov 09 '16 at 13:18
  • @VanceFaulkner a GMT offset is also a timezone option. After asking internally, we basically record and use whatever timezone the phone sends to us, so it's up to the phone whether it will be an Olson, a seconds offset, or a GMT offset. – RAY Nov 09 '16 at 18:38
  • Thanks, Ray. It shouldn't be hard to handle those scenarios although it might be worth updating the documentation on the Jawbone site. – Vance Faulkner Nov 10 '16 at 11:57