I want to convert NSString to NSDate but UIPickerView shows current date
- by Ali
I want to convert NSString to NSDate but UIPickerView shows current
datedatePicker=[[UIDatePicker alloc]init];
datePicker.userInteractionEnabled=YES;
datePicker.minuteInterval=5;
NSLog(@"Date");
////////
NSString *curDate=alarmData.date;
//Jan 14, 2011 11:37
NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"MMM dd, yyyy HH:mm"];
//Optionally for time zone converstions
[format setTimeZone:[NSTimeZone timeZoneWithName:nil]];
NSDate *da = [format dateFromString:curDate];
[datePicker setDate:da animated:YES];
any suggestions