I have a date string like this "2013-04-25T08:00:00.000+0000" what is the right way to read it as a date.
I tried all this:
How to convert NSDate into unix timestamp iphone sdk?
iOS - Proper formatting of timestamps between mySQL (apache) and iOS (NSDate)
converting timestamp to nsdate format
and I tried this too:
+(NSDate *)dateFromUTCTimeStamp:(NSString *)dateString
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss'Z'";
NSTimeZone *gmt = [NSTimeZone timeZoneWithAbbreviation:@"GMT"];
[dateFormatter setTimeZone:gmt];
NSDate *timeStamp = [dateFormatter dateFromString:dateString];
return timeStamp;
}
everything returns nil, I know I am making a simple mistake but need some help.