Unable to parse using NSDateFormatter

I get RSS in which I get the following date stamp:

2010-05-10T06:11:14.000Z

Now I use NSDateFormatter to parse this date and time stamp.

[parseFormatter setDateFormat:@"yyyy-MM-dTH:m:s.z"];

But it doesnโ€™t work fine, if you just delete part of the timestamp, it works for the date. [parseFormatter setDateFormat:@"yyyy-MM-d"];But if I add the rest of the material, it will return zero.

Any idea?

Thanks in Advance ....

+5
source share
2 answers

You need to parse the null values โ€‹โ€‹for d, H, m, s

You need to print literal Tas'T'

You need to analyze the fractional part of seconds with SSS

Z 'Z' Z, , RSS .

@"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"

+26

. , :

0

All Articles