I have a date format coming from server as 2013-12-30T14:59:00.+0000 i want to convert this into the the format MMM dd,yyyy h:mm a
Im doing as below
NSDateFormatter *dateFormatter =[[NSDateFormatter alloc] init];
NSTimeZone *timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"];
[dateFormatter setTimeZone:timeZone];
NSDate *dateFromString = [dateFormatter dateFromString:selectedDate];
if (dateFromString != nil)
{
[dateFormatter setDateFormat:@"MMM dd,yyyy h:mm a"];
stringDateFromDate = [dateFormatter stringFromDate:dateFromString];
}
But the "dateFromString" coming as nil.
Can any one help here