How to convert yyyy-mm-dd formatted date to 'long date' format using jquery?

后端 未结 4 1217
故里飘歌
故里飘歌 2021-01-22 13:18

I have date in yyyy-mm-dd format. It is found to be ISO Date format. I need to convert it to Long Date format.

eg: I have date as \'2015-07-15\'. The converted date for

4条回答
  •  旧巷少年郎
    2021-01-22 14:08

    var months=["jan","feb","march","April","may","jun","july","August","sept","oct","nov","dec"];
    var dateValue=new Date();
    var date=dateValue.getDate();
    var year=dateValue.getFullYear()
    console.log("Today is :"+date+ "  "+months[dateValue.getMonth()]+"   "+year);
    

提交回复
热议问题