I am having an issue with a time picker and cannot figure out what my issue is. Here is my code;
timePicker.timeZone = [NSTimeZone localTimeZone];
NSDate *selected = [timePicker date];
NSString *message = [[NSString alloc] initWithFormat:
@"The date and time you selected is: %@", selected];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Date and Time Selected"
message:message
delegate:nil
cancelButtonTitle:@"Yes, I did."
otherButtonTitles:nil];
[alert show];
So for example if I select the time 2:55 pm the alert returns “2012-08-14 19:55:37 +0000”
It has to be something super simple just cannot see it
NSDate has no concept of timezones. It just stores the neutral time information. So you have to correct your output to compensate.
You could create an instance of NSDateFormatter and then setTimeZone: