02-06-2018 22:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

02-06-2018 22:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
