I am writing an application that includes a time zone. I want to capture the time of the user device, called dateA , and I have the target date, which will always be in the time zone of EDT ( dateB ).
I want to get the difference between two dates and show the user, but in dateB timezone.
eg:
user device time is 07:30 AM PDT, and dateB is 11:00 Eastern time.
Thus, the time difference will be 30 minutes.
My algorithm:
1) Get user device time
2) convert to EDT
3) capture the time difference between dateA and dateB
My problem is that after getting user device time [NSDate date] and go DateFormatter with EDT DateFormatter . Time does not change.
EDIT ::
NSDate *localDate = [NSDate date];
How come convertTimeString does not contain 10:30 in EDT? What am I doing wrong?
CLDev source share