I am fetching a RSS, in which i receive the following Date stamp:
2010-05-10T06:11:14.000Z
Now i am using NSDateFormatter to parse this datetime stamp.
[parseFormatter setDateFormat:@"yyyy-MM-dTH:m:s.z"];
But its not working fine if just remove the time stamp part it works for the date [parseFormatter setDateFormat:@"yyyy-MM-d"];
But if i add the rest of the stuff it returns nil.
Any idea ?
Thanks in Advance....
You need to parse zero padded values for d, H, m, s
You need to escape the literal T
as 'T'
You need to parse the fractional part of the seconds with SSS
You can accept a literal Z
with 'Z'
or use uppercase Z to try and parse the timezone but RSS uses separate standard.
@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
Date Format Patterns
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With