I am trying to convert date from string ,
Below is my code,
str_date = @"04/16/2011 00:00:00 AM";
NSDateFormatter *dtF = [[NSDateFormatter alloc] init];
[dtF setDateFormat:@"MM/dd/yyyy HH:mm:ss a"];
NSDate *d = [dtF dateFromString:str_date];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"yyyy-MM-dd"];
NSString *dateString = [dateFormat stringFromDate:d];
[dateFormat release];
return dateString;
Here the issue is, in the simulator it is working fine and converts string to date and date to string, but with Device, it is not able to convert string to date
In iPod retina it is not showing the date, but with iPhone 3gs it shows the date
Please help me what wrong I have made ?