NSDateFormatter setDateFormat non-zero-padded month number
-
03-06-2021 - |
Frage
Is it possible to get the non-zero-padded month number using setDateFormat
?
If not, could you provide an alternative solution?
Lösung
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.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow