NSDateFormatter problem
Posted
by jeeva
on Stack Overflow
See other posts from Stack Overflow
or by jeeva
Published on 2010-05-10T07:45:14Z
Indexed on
2010/05/10
8:04 UTC
Read the original article
Hit count: 495
nsdateformatter
|cocoa-touch
I am trying to get NSDate from string but its returning nil. I tried this:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-mm-dd'T'HH:mm:ss'Z'"];
NSDate *date = [dateFormatter dateFromString:@"2010-05-07T10:12:32UTC"];
NSLog(@"Success date=%@",[date description]);
Thanks
© Stack Overflow or respective owner