I have a current NSString in the format of 2010-04-23 00:00:00 and then I'm trying to get the number of days passed from the current day. However, I'm not sure how to handle when the user changes their locale to Thailand for example.
Here is some of the code.
NSString *start = @"2010-04-23 00:00:00";
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSDate *date = [formatter dateFromString:start];
//Region Format Thailand
NSDate *today = [[NSDate alloc] init];
NSTimeInterval difference = [today timeIntervalSinceDate:start];
int numberOfDays = difference / 86400;
What would be the correct way to handle this situation so the number of days difference is accurate?