Using moment.js to convert date to string “MM/dd/yyyy”

后端 未结 6 1663
有刺的猬
有刺的猬 2021-01-31 06:55

I need to take the date value from jquery datepicker turn it into string format \"MM/dd/yyyy\" so it can do the right ajax post. When the page loads or upon changing the datepic

6条回答
  •  离开以前
    2021-01-31 07:24

    Try this:

    var momentObj = $("#start_ts").datepicker("getDate");
    
    var yourDate = momentObj.format('L');
    

提交回复
热议问题