ios - How do I get rid of the extra 0 being displayed on hours when i format timestamp to NSDate string? -
[dateformatter setdatestyle:nsdateformattermediumstyle]; [dateformatter setdateformat:@"hh:mm a"]; nsstring *strdate = [dateformatter stringfromdate:taskstartdate];
right outputting times : 01:00pm instead of 1:00pm
if don't want 2-digit hour, don't format hh
. use h
.
[dateformatter setdateformat:@"h:mm a"];
Comments
Post a Comment