Convert dd-mm-yyyy string to date

后端 未结 14 1909
孤城傲影
孤城傲影 2020-11-22 05:09

i am trying to convert a string in the format dd-mm-yyyy into a date object in JavaScript using the following:

 var from = $(\"#datepicker\").val();
 var to          


        
相关标签:
14条回答
  • 2020-11-22 06:15

    Use this format: myDate = new Date('2011-01-03'); // Mon Jan 03 2011 00:00:00

    0 讨论(0)
  • 2020-11-22 06:15

    Take a look at Datejs for all those petty date related issues.. You could solve this by parseDate function too

    0 讨论(0)
提交回复
热议问题