문제

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

If not, could you provide an alternative solution?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top