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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

post - imageshack API cURL -

dataset - MPAndroidchart returning no chart Data available -