04-22-2020 23:43
04-22-2020 23:43
Hi,
I am a mobile application development engineer. I use fitbitApi to sync data recorded by users on my app to fitbit. The body weight date parameters is based on the timezone configured in the user's profile or use the phone setting timezone?
The time zone of the phone is different from the time zone of the Fitbit app。
iOS platform:
The logweight request is success, but is not display in Fitbit ios app .
Android platform:
The logweight request is success, also be seen on Fitbit android app
04-24-2020 14:38
04-24-2020 14:38
Hi @VeSncDeveloper,
Welcome to the forums!
All date and time-related fields in the API requests and responses are rendered in the local time of the resource owner's timezone (either authorized user or the owner of the resource requested) that they've set on their fitbit.com profile.
A user's current time zone and UTC offset in milliseconds can be retrieved through the Get Profile endpoint.
I hope this helps. Let me know if you have any additional questions.
06-09-2020 17:56
06-09-2020 17:56
I've recently started developing using the Fitbit API as well and this is something that takes a lot of effort to work with. While one can indeed derive the UTC offset or the timezone from the profile, that's only applicable when looking at data from today but not for historic trending.
Most countries change timezones twice a year using daylight savings, and the UTC offset is invalid. One can take the timezone and then try to run calculations on what the offset was at that time but it's clunky. If a user moves to a different timezone, it also becomes invalid with no way to account for it.
Both scenarios above are easily mitigated by adding another field like 'logIdUTC' with the timestamp at UTC. It should be easy to add on your end and makes life for developers so much easier.
06-10-2020 14:13
06-10-2020 14:13
Hi @PatrickP,
This is a great suggestion and I'll definitely bring it up to the team.
In the meantime, I recommend posting this idea at our Web API Feature Suggestions page to begin tracking interest with other developers who share the same mindset. Don't forget to include the Web API label so that it gets categorized correctly:
https://community.fitbit.com/t5/Feature-Suggestions/idb-p/features/label-name/web%20api
We are working on ways to standardize our APIs and we'd love to see feedback from the rest of the community. When an idea tracks enough interest, our product teams may take them into consideration and add them to our roadmaps.
I hope this helps and I look forward to seeing more of your suggestions.
06-11-2020 14:37
06-11-2020 14:37
@PatrickP It looks like our team has previously been made aware of this enhancement request. In the meantime, they recommended that if you are by any chance using the activity and heart rate intraday and time series endpoints, you can add a "timezone=UTC" parameter to the endpoint and you'll be returned with the time series data in UTC.
Are there certain endpoints you wish to see UTC times returned in?
06-11-2020 17:39
06-11-2020 17:39
I was specifically looking for the ones in this topic (https://api.fitbit.com/1/user/-/body/log/weight/date/2020-06-10/1m.json) and hope the ?timezone=UTC can be added to that one as well.
The body time series doesn't quite give me what I'm after, as it averages out the data on days there is no weigh-in which looks a bit fudged for periods where there isn't a weigh-in for a while. It also doesn't account for multiple weigh-ins on a date, hence why I'm using the /body/log/weight endpoint.