Parse DateTime string in JavaScript

前端 未结 9 2186
别跟我提以往
别跟我提以往 2020-11-22 12:15

Does anyone know how to parse date string in required format dd.mm.yyyy?

9条回答
  •  遇见更好的自我
    2020-11-22 12:52

    you can format date just making this type of the code.In javascript.

     // for eg.
                  var inputdate=document.getElementById("getdate").value);
                     var datecomp= inputdate.split('.');
    
                    Var Date= new Date(datecomp[2], datecomp[1]-1, datecomp[0]); 
                     //new date( Year,Month,Date)
    

提交回复
热议问题