datetime - IOS date to string gives me wrong date -
i working time stamp shows following server:2015-07-23t17:08:00z. however, have tried multiple ways extract month , keeps returning "january". when turn date stamp string, following:2015-01-23 17:08:00 +0000. know why month keeps getting reverted jan? year day , time fine... appreciated.
this code works me:
nsstring *dateasstring = @"2015-07-23t17:08:00z"; nsdateformatter *dateformatter = [nsdateformatter new]; dateformatter.dateformat = @"yyyy-mm-dd't'hh:mm:ssz"; nsdate *date = [dateformatter datefromstring:dateasstring]; nslog(@"%@", date);
my guess have wrong symbol month in nsdateformatter
.
Comments
Post a Comment