objective c - How to set a custom date format in iOS? -
i want display data int next format: 14:23 sep 10,2012
.how can this?
use nsdateformatter
nsdateformatter *dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"hh:mm mmm dd,yyyy"]; nsstring *stringfromdate = [dateformatter stringfromdate:[nsdate date]]; nslog(@"today : %@", stringfromdate);
Comments
Post a Comment