Get month name from two digit month number

后端 未结 4 1060
既然无缘
既然无缘 2021-02-02 09:26

I want to get month name from two digit month number (ex- 09). I tried with this code. But it doesn\'t work. The code give current month name only. What are the correct code for

4条回答
  •  萌比男神i
    2021-02-02 10:06

    You need to pass the month as a number, not text - so...

    var formattedMonth = moment().month(9).format('MMMM');
    console.log(formattedMonth)
    

    Result: October

提交回复
热议问题