I have a line taken from the header field of the HTTP response "Date" in this format:
"Sun, 24 Jun 2012 16:34:51 GMT"
I want to convert this string to an NSDate object. For this area, I created an instance of NSDateFormatter using a different format:
[dateFormatter setDateFormat:@"EEE',' dd' 'MMM' 'yyyy HH':'mm':'ss zzz"]; [dateFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss zzz"]; [dateFormatter setDateFormat:@"EEE',' dd' 'MMM' 'yyyy HH':'mm':'ss 'GMT'"];
but when I print a string from a date using:
[dateFormatter dateFromString:date]
I get:
(null)
where am i doing wrong?
Luckystar
source share