ios - NSDateFormatter returning null, but was working just fine before -
i had code work while, stopped working, , returns null, although date valid. here code , output:
nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"hh:mm dd.mm.yyyy"]; nslog(@"date - %@, formatted date - %@", self.date, [dateformatter stringfromdate:self.date]); date - 2013-09-02 10:00:00, formatted date - (null)
it works me.
output:
2013-09-04 10:51:10.681 untitled[753:707] date - 2013-09-04 08:51:10 +0000, formatted date - 10:51 04.09.2013
i used:
nslog(@"date - %@, formatted date - %@", [nsdate date], [dateformatter stringfromdate:[nsdate date]]);
so there must self.date. can explain or paste more code self.date.
Comments
Post a Comment