How to parse date with time in Objective C

263 Views Asked by At

I have dates in format e.g.

2014-12-09T11:10:23.0000000-08:00

How To parse this date & get 2014-12-09T11:10:23.

Please Help I have tried with many date formatters in setDateFormat: method.

1

There are 1 best solutions below

2
On BEST ANSWER

setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSZZZZZ"

(It's all in the spec if you bother to look.)