Bootstrap datepicker — how to get date as a string in the right format?

前端 未结 3 1639
太阳男子
太阳男子 2021-02-19 08:15

I\'m using Bootstrap datepicker. The answer is probably obvious, but I can\'t figure out how to get the selected date as a string in the specified format. I used:



        
3条回答
  •  忘掉有多难
    2021-02-19 08:27

    If you want the value as a string use: var value = $("#myDate input").val();

    The method getDate returns an object

提交回复
热议问题