ios - Date Format of full date response -
this question has answer here:
i have date string:
2014-03-09t00:00:00+01:00
tried parse timestamp using code:
nsdateformatter * dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"yyyy-mm-dd't'hh:mm:ss"]; nsdate *date = [dateformatter datefromstring:response]; nslog(@"%@", date); nstimeinterval timestamp = [date timeintervalsince1970];
but returns nil in nslog
. proper dateformat date string?
i use same date format in android app , works not in obj-c.
try this:
[dateformatter setdateformat:@"yyyy-mm-dd't'hh:mm:ssxxx"];
Comments
Post a Comment