Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSDateFormatter setDateFormat non-zero-padded month number

Is it possible to get the non-zero-padded month number using setDateFormat?

If not, could you provide an alternative solution?

like image 757
Tyilo Avatar asked Apr 25 '12 00:04

Tyilo


1 Answers

Use M instead of MM in the format string. If you use two letters, you specify that the result should have two digits, if you don't, the result can have one or two digits.

like image 117
sch Avatar answered Oct 22 '22 15:10

sch