Remove 0 at beginning of formatted time

I have an NSDate formatted with NSDateFormatter as "hh:mm:ss". Everything displays properly except when the hour is one digit (e.g. 3:00) it would display 03:00. How would I get rid of that 0 so it would display 3:00?

Upvotes: 5

Views: 3482

Answers (1)

Kara
Kara

Reputation: 6226

If you use 1 h instead of two you will not get the leading 0.

h:mm:ss

Upvotes: 23

Related Questions