iphone - NSDate date format issues when trying to convert date to UTC -
i trying convert nsdate utc date , using..
nsstring* datestring= [nsdate utcstringfromdate:[nsdate date] withformat:@"yyyy-mm-dd't'hh:mm:ss.ssz"]; + (nsstring *)utcstringfromdate:(nsdate *)date withformat:(nsstring *)format{ nsdateformatter *outputformatter = [[nsdateformatter alloc] init]; [outputformatter settimezone:[nstimezone timezonewithabbreviation:@"utc"]]; [outputformatter setdateformat:format]; nsstring *timestamp_str = [outputformatter stringfromdate:date]; [outputformatter release]; return timestamp_str; }
this works fine of times , gives me result similar this.
2013-05-03t05:30:25.18+0000
but @ times gives me strange value like
2013-04-26t12:03:53 a.m..24+0000
now not sure why that..
thanks help.
Comments
Post a Comment