Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Timezone about logWeight、logFat

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

Best Answer
0 Votes
5 REPLIES 5

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.

 

Best Answer
0 Votes

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.

Best Answer
0 Votes

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.

Best Answer
0 Votes

@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?

Best Answer
0 Votes

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.

Best Answer
0 Votes