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

API return incorrect time zone in activities

I am using fitbit API to get Activities, when i parse the date in India it shows a 30 minutes difference from dashboard of fitbit.
suppose i am gettiing date in String is "2018-02-06T00:16:15.000-06:00" 
when i convert it into india time i am getting 11:46 AM while in fitbit dashboard it showing 12:16 AM
when i change the above format into  "2018-02-06T00:16:15.000-06:30" i am getting exact same time.

I am using the following code to convert

String to Date function code:

let formatter = DateFormatter()

formatter.dateFormat"yyyy-MM-dd'T'HH:mm:ss.sssZZZ"

return formatter.date(from: self)

Then, above Date to local Date String

formatter.dateFormat = "HH:mm a"

formatter.timeZone = TimeZone.current

return formatter.string(from: self)


output: 11:46 AM


How to Solve this issue. Please Help me out. Thanks

Best Answer
0 Votes
0 REPLIES 0